in reply to Memory problems with GD
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 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Memory problems with GD
by perldough (Sexton) on Aug 02, 2012 at 14:31 UTC | |
by etj (Priest) on May 23, 2022 at 19:53 UTC | |
by zentara (Cardinal) on Aug 02, 2012 at 17:07 UTC |