This leak appears to have been fixed in perl-5.14.0. 5.10.1 is over 5 years old, so you may wish to upgrade to something newer.
Dave. | [reply] |
Hi FrankyGT, welcome to the Monastery!
What OS and Perl version do you run? How do you measure the heap? Your code is running on my machine (Win7, cygwin, Perl 5.14.4) for 6 minutes now and I see no problem.
| [reply] |
On my system, your code uses a constant, unchanging 3.9MB.
So the problem is not with "perl threads"; but with your system.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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.
| [reply] |
Memory consumption
On most systems, frequent and continual creation and destruction of threads can lead to ever-increasing growth in the memory footprint of the Perl interpreter. While it is simple to just launch threads and then ->join() or ->detach() them, for long-lived applications, it is better to maintain a pool of threads, and to reuse them for the work needed, using queues to notify threads of pending work. The CPAN distribution of this module contains a simple example (examples/pool_reuse.pl) illustrating the creation, use and monitoring of a pool of reusable threads.
| [reply] |
Some more info : This is on perl 5.10.1 on solaris 10 (csw perl)
Tried the same on linux perl 5.10, and I don't see it there. The VM size starts with 200MB, and stays that way. | [reply] |