in reply to does threads (still) memleak?
I think you should look at OS memory reclamation with threads on linux. Depending on your kernel, OS, computer speed, available free memory, etc, memory reclamation will change. I would guess that with so much demand from the script, and with alot of free memory, the kernel may be playing it safe and not freeing all the time. You might try running it with a sleep 1 in your loop, and give the kernel time to free things up. I'm trying it now, bit it may take a while :-)
I have perl 5.8.8, and the latest threads from cpan, running on linux. When the script below starts, its at 15M, and at count 10,000, it is up to 20M. On the way up it seems to oscillate, going up a bit, going down a bit, but generally on an upward trend.
#!/usr/bin/perl use threads; use strict; use warnings; my $count=0; for (;;) { print $count++.' '; my $thr = threads->new( sub { my $a = [ 1 .. 10000] } )->join; undef $thr; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: does threads (still) memleak?
by faxm0dem (Novice) on Nov 21, 2008 at 12:48 UTC | |
by zentara (Cardinal) on Nov 21, 2008 at 13:38 UTC | |
by BrowserUk (Patriarch) on Nov 21, 2008 at 14:20 UTC | |
by zentara (Cardinal) on Nov 21, 2008 at 17:01 UTC | |
by faxm0dem (Novice) on Nov 24, 2008 at 13:16 UTC | |
by BrowserUk (Patriarch) on Nov 24, 2008 at 13:55 UTC | |
by faxm0dem (Novice) on Nov 24, 2008 at 15:55 UTC | |
| |
by zentara (Cardinal) on Nov 24, 2008 at 15:55 UTC |