Re: imagedestroy problems with memory

From: Date: Sat, 15 May 2004 16:02:55 +0000
Subject: Re: imagedestroy problems with memory
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-186317@lists.php.net to get a copy of this message
Merlin wrote:
Hi there, I am having trouble with ram memory. After about a day the system starts to swap. After doing a bit of research I found that a possible reason could be the missing of the imagedestroy() function. There is a question I have on that. Inside a function I add sometimes watermarks to images, than I return the image from the function. Where would I have to place the imagedestroy command? Inside the function, or after calling it? Here is part of the function code: ######################################### # save image to var to make saving possible in db into blob ob_start();
    imagejpeg($photoImage);
    $photoImage     = ob_get_contents();
ob_end_clean();
#########################################           return $photoImage;
thankx for any help, Merlin
Inside the function right after imagejpeg(). $photoImage = ob_get_contents() makes $photoImage a string, so imagedestroy() cannot be called on it.

« previous php.general (#186317) next »