[ABE.pm] Perl and memory usage
fiedlert at gmail.com
fiedlert at gmail.com
Tue Nov 17 08:52:02 PST 2009
> Let me know if you find a good strategy.
Voodoo is a good word.
This is far from perfect, there has to be a better way - but Im going to
use this for now:
So you ned to find a sweet spot where you dont get Perl 'Out of Memory!'
conditions. It was 11 for me.
So I just keep running
./memeater 11 &
over and over until I get OOM kills. Now I just need to do some tuning.
#!/usr/bin/perl
use strict;
use warnings;
use threads;
#use Devel::Size qw(size);
my $mem;
my $iterations = $ARGV[0] || 5;
my $count = 0 ;
while ($count < $iterations)
{
my $thr = threads->new(\&fillmeup);
#my $size = size($thr);
#print "Size = $size \n";
$count++;
}
sleep 900;
sub fillmeup
{
my $buf = 'A' x ( 1024*1024*256 );
return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/abe-pm/attachments/20091117/716306f8/attachment.html>
More information about the ABE-pm
mailing list