On Wed, Oct 24, 2001 at 11:12:19AM +0200, Gabriel Kihlman wrote:
> 
> The comments in thrash.perl mention that it test for memory leaks.
> And by running it you can see that it does leak memory (perl 5.6.1 and
> 0.17).
> 
> A quick glance at the code show no obvious data storage that could
> explain it so I am wondering if it is supposed to increase its memory
> usage?

[...]

Confirmed here, but I can't find the cause.

If there's a filehandle leak, the fileno() on new sockets should
increase "forever".  I added fileno() assertions, but they haven't
triggered:

  die "possible filehandle leak" if fileno($handle) > 63;

It could be a data leak in POE::Kernel.  POE::Kernel keeps references
to all its sessions, and they in turn keep references to their HEAPs,
and those reference "user" data, so dumping $poe_kernel gets just
about everything visible from user space.

I added code to dump a snapshot of the Kernel every ten seconds:

  open( TRACE, ">trace." . time() ) or die $!;
  use Data::Denter;
  print TRACE Denter($poe_kernel);
  close TRACE;

The trace sizes bobble between 19000 and 23000 bytes, but they don't
expand much more than that.

Maybe the leak is in some circular reference that is unlinked from
$poe_kernel but never disappears.  Is there a way to check for that?

-- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sourceforge.net

Reply via email to