Re: imagedestroy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Sorry if this is an old subject but it's new to me. I have a 'default'
> Fedora Core 1 installation of Apache2 v2.0.48 and php v4.3.8. I've
> noticed a problem in one of the scripts i had written a few months ago,
> but I was testing it on a Red Hat 8 system at the time and I'm not sure
> if the memory limit is default on that system or not. Anyway, what I've
> got is a script that is generating thumbnails from a batch of images in
> a directory, about 5000 images are being counted. While the script
> worked fine when i wrote  it a few months ago, on the different system,
> I was recently trying to use it and was repeatedly getting memory limit
> errors at an 8MB limit. What the script does is load an image in
> memory, create three different thumbnail sizes for the image,
> imagedestroy() is being called after each thumbnail build to kill the
> thumb, and then finally I'm calling imagedestroy() at the end of the
> iteration for that image to kill the original in memory before going on
> to the next image. What it appears to me is that imagedestroy() is not
> actually freeing the memory for use on the next cycle. While this
> doesn't really effect the scripts I have that are just generating
> thumbnails from a single image, the batch scripts I have are
> continually failing after about three iterations. I did increase the
> memory limit enough to get the script to finish, and php is apparently
> doing it's job in cleaning up when the script finishes so there's not a
> real threat to the server if I run the scripts during slow times. But
> it is a bit annoying that the function isn't working as it should. I
> noticed a few memory issues in the bugs pages relating to gd, and the
> resolution stated that it was a gd problem,  so I didn't want to bother
> the php maintainers with another one. What I'm wondering is if anyone
> else has noticed this behavior, and aside from increasing the memory
> limit, have you found an alternative? I'm really trying to keep the
> scripts I have portable, so I haven't looked at ImageMagic, but I was
> wondering if the shmop functions might be the way to go with this. I do
> have reservations about using that though since it's not a 'default' in
> the build and I have some servers that I have no control over the
> software side of things, and I am trying to make these as generic as
> possible. If you've gotten this far thanks, sorry it turned out to be
> so long, but this is a rather important problem in what I'm coding.

It's entirely possible that imagedestroy() works fine, but you've got some
*other* memory leak going on...



-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux