in reply to memory leak with Thread::Queue ?

Your code (slightly modified for win32), doesn't appear to leak under AS811/5.8.6 or AS817/5.8.8.

#!/usr/bin/perl use strict; use warnings; use threads; use Thread::Queue; my $queue = Thread::Queue -> new; threads -> create ("popper", $queue) -> detach for (1..10); my $message="this is a line of test around the right size"; while (1) { $queue -> enqueue ($message) for (1..100); sleep 1 while $queue -> pending; system qq[tasklist /nh /fi "PID eq $$"]; } sub popper { print "started a popper\n"; my $queue = shift; while ($queue -> dequeue) { print "."; } } __END__ C:\test>junk5 started a popper started a popper started a popper started a popper started a popper started a popper started a popper started a popper started a popper started a popper perl.exe 3128 0 6,936 +K perl.exe 3128 0 6,944 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K perl.exe 3128 0 6,948 +K

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: memory leak with Thread::Queue ?
by Anonymous Monk on Sep 18, 2009 at 22:04 UTC
    This problem is present on RHEL5 running 5.10.0, and RHEL5 running 5.10.1. It is NOT present on RHEL4 running 5.10.0. I don't understand why.

      I'd suggest you re-post this under dave_the_m's post above (or take it directly to p5p), as he understands the problem and is best place to suggest how to fix it.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.