|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-12 01:17 UTC] jani@php.net
[2008-04-20 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 00:00:02 2025 UTC |
Description: ------------ I have a resizeimage page taht I use to display intermediate size pics on my viewer page. It resizes one image every time it is ran. After a few hours apache is taking up like 600 meg of ram and the page will not load anymore. Reproduce code: --------------- $dst_img = imagecreatetruecolor($dest_w, $dest_h); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_w, $dest_h, $srcsize[0], $srcsize[1]); switch($srcsize['mime']) { case "image/jpeg": header("content-type: image/jpeg"); imagejpeg($dst_img); break; case "image/png": header("content-type: image/png"); imagepng($dst_img); break; case "image/gif": header("content-type: image/gif"); imagegif($dst_img); break; } // Destroy images imagedestroy($src_img); imagedestroy($dst_img); Expected result: ---------------- That is part of the code. The beginning part opens the file and gets the info about it to know which one to use. I would expect using imagedestroy at the end for both images would remove it from memory. Actual result: -------------- Some memory is regained, but not all the time.