in reply to ithreads memory leak
the memory usage balloons about 6MB each time. At random points the ballooning stops, and PERL will reclaim seemingly about 1MB of memory, then start ballooning again.
What happens if you recast the code as follows?:
use warnings; use IO::Handle; use threads stack_size => 64*1024; use strict; use DBI; use Email::MIME; use Email::Sender::Simple qw(sendmail); while (<STDIN>) { chomp(my $msg = $_); print "Received: $msg\n"; if ($msg =~ /start/) { threads->create(\&thread)->detach; } } sub thread { print "Thread started!\n"; sleep 5; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: ithreads memory leak
by DNAb (Novice) on Apr 08, 2015 at 18:03 UTC | |
by BrowserUk (Patriarch) on Apr 08, 2015 at 18:13 UTC | |
by DNAb (Novice) on Apr 08, 2015 at 19:17 UTC | |
by BrowserUk (Patriarch) on Apr 08, 2015 at 19:45 UTC | |
by DNAb (Novice) on Apr 08, 2015 at 22:38 UTC | |
|