Okay. Code snippet is here:
my %dummies; foreach (1..100) { srand; my $extra = int(rand(256)); warn "ralph" . $extra . "\n"; $dummies{$_} = dacts ( "ralph" . $extra, "myvoiceismypassword", "127.0.0.1", 8888 ); } for (;;) { }
this code is only slightly different from the code available in this node concerning writing to a slew of sockets with a threaded module, MP3::Napster. As you can (almost) see, this small codelet just spawns 100 new objects ($dummies{$_}), which all sit there and do nothing. There is actually an intended function for it, but as yet, I cant get to the 100 objects. What happens is the script starts up and spawns like crazy, very quickly, and then stops at right around 65 objects. Furthermore, most of the functionality on the computer ceases. So I ran it nice -n 20, and had a qx,top, runing at a -20 priority and I STILL couldnt see what perl was doing after about the 65th new object. At this point I decided I needed to break out the heavy artillery and ran strace. Eeep, this was alarming. The output of strace is here (at least the last 10 or so lines):

write(2, "connected to server\n", 20connected to server ) = 20 write(2, "username: ralph187 | password: m"..., 82username: ralph187 | + password: myvoiceismypassword at alternativejoin.pl line 17. ) = 82 rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0 write(67, "3\0\2\0 ralph187 myvoiceismypasswor"..., 55) = -1 EAGAIN (R +esource temporarily unavailable) rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_IGN}, 8) = 0 time(NULL) = 979853416 time(NULL) = 979853416 _newselect(0x48, 0x1061a1f0, 0, 0, 0x7ffff938 <unfinished ...>

I thought about this for a little while and decided to check /var/log/messages. I guess not very surprisingly, I found:

Jan 18 16:23:52 macachu kernel: __alloc_pages: 2-order allocation fail +ed. Jan 18 16:23:52 macachu last message repeated 639 times Jan 18 16:23:52 macachu kernel: ed. Jan 18 16:23:52 macachu kernel: __alloc_pages: 2-order allocation fail +ed. Jan 18 16:26:46 macachu last message repeated 455 times Jan 18 16:28:41 macachu last message repeated 123178 times Jan 18 16:28:55 macachu last message repeated 30800 times Jan 18 16:28:55 macachu kernel: ed.

Well duuhhhh, youre out of memory, deprecated! Not so fast. I have 192MB of physical memory and 384MB of swap. And neither disk was swapping. So while this seems to be a system limitation, it also doesnt seem to be using up all the memory available. I see some stuff in the strace about SIGPIPE and so on...? Should I be capturing it in perl? i.e., $SIG{PIPE} = sub { handle here }; ??

Relevant information:

Linux macachu 2.4.0-test11 #1 Thu Dec 7 15:51:21 EST 2000 ppc unknown cpu : 750 clock : 400MHz bogomips : 796.26 motherboard : PowerMac1,1 MacRISC Power Macintosh L2 cache : 1024K unified memory : 192MB
I've got to admit here, I'm pretty stumped. I would feel better about this if I appeared to be using all my ram.
Thanks fellow monks.

deprecated

--
i am not cool enough to have a signature.


In reply to So is this a kernel limitation, a hardware limitation, or a perl limitation? by deprecated

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.