in reply to Event.pm memory leek ?

Maybe...

Programs using signals are tricky in perl (well, actually in any language), and I have been looking at Event.pm source code, and it is anything but simple, so I would not discard some bug there.

Also because you are (ab)using the module in some unusual way, sending a HUP signal from the HUP signal handler all the time without letting it rest for a while...

Yes I know, that sounds a bit silly, programs don't need to rest, but I have a reason to say that: the way perl vars are freed, marking them as mortals (see perlxs, perlguts and perlapi man pages for what's a mortal explanations).

Maybe Event.pm only closes the callback calling scope when the event queue is empty, and not after every callback invocation...

So, summarizing: send a bug report to the module author!!!

Replies are listed 'Best First'.
Re^2: Event.pm memory leek ?
by asdfgroup (Beadle) on Apr 22, 2005 at 19:07 UTC
    Looks like this is really some memory leak in Event.pm, becuase code like this :
    use Event; pipe(R,W); Event->io(fd=>\*R, poll=>"r", cb=>sub {sysread R, $r, 1 or warn "read: + $!"; syswrite W, $r, 1 or warn "write: $!"; i++}); Event->signal(signal=>'ALRM', cb=>sub {printf "%d\t%d\n", ++$t, $i-$ol +d_i; $old_i=$i; alarm 1}); alarm 1; syswrite W, "!" or die $!; Event::loop;
    produce memory leak as well :(