This ImageMagick script seems to hold memory down to runnable levels, although I have not taken it beyond a 20 count. :-)
#!/usr/bin/perl use warnings; use strict; use Image::Magick; # largeimage.png is around 180 meg my $im = Image::Magick->new; # only make one object for my $i (0 .. 500) { print "$i\n"; test(); } sub test{ my $path = 'largeimage.png'; $im->Read($path); undef @$im; #needed if $im is created outside loop }
In reply to Re: Memory problems with GD
by zentara
in thread Memory problems with GD
by perldough
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |