Hi.
I'm running PHP 4.3.4 with bundled GD 2.0.1.5

Here is the problem:
I'm running a PHP shell script to fix about a thousand image files that were uploaded to a server without much error checking.
I'm skipping all the obvious problems like wrong file types and insanely large jpeg files but after that, each file is getting processed with GD, using imagecreatefromjpg(). I'm still running the script in test mode at the moment so I'm not doing any processing, just watching for errors. I am calling imagedestroy() after each loop but ... around about the 150th image, imagecreatefromjpg() stops the script with the error "Allowed memory size of 33554432 bytes exhausted (tried to allocate 9144 bytes)." After making minor adjustments, it will process more or less images so it doesn't seem to be getting stuck on a particular file (the file it stops on now is a 32KB jpeg).


My question is: is there any other function or method to relieve PHP of some memory? Could it be that imagedestroy() is not freeing all memory properly? a memory leak? I would rather not have to do only a few images at a time since there should be no problems crunching through them all at once. Any suggestions for general memory optimization?

thanks, Kumar

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to