ID:               41411
 Updated by:       [EMAIL PROTECTED]
 Reported By:      eth at ethaniel dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         GD related
 Operating System: Linux FC 6 2.6.18
 PHP Version:      5.2.2
 New Comment:

./sapi/cli/php -r 'var_dump(memory_get_usage()); $newImg =
ImageCreateTrueColor(500, 375); var_dump(memory_get_usage());'
int(88476)
int(1069836)



Previous Comments:
------------------------------------------------------------------------

[2007-05-16 17:55:42] eth at ethaniel dot com

Sorry, I messed up when submitting the bug report. Expected and Actual
results fields are to be switched places.

------------------------------------------------------------------------

[2007-05-16 17:54:24] eth at ethaniel dot com

Description:
------------
I run a image thumbnail service on my server, it runs under priority of
+11. It has a memory limit set to 520M.

On some images it exits with "Allowed memory size of 545259520 bytes
exhausted" when I do imagecreatetruecolor(500,375). 

Memory usage details below.

Reproduce code:
---------------
if ($photo_id==2348804) error_log(memory_get_usage()." - $newX -
$newY");

$newImg = ImageCreateTrueColor($newX, $newY);

if ($photo_id==2348804) error_log(memory_get_usage()." - $newX -
$newY");

Expected result:
----------------
following entry in error log

[16-May-2007 19:10:27] 6451636 - 500 - 375
[16-May-2007 18:34:24] PHP Fatal error:  Allowed memory size of
545259520 bytes exhausted (tried to allocate 2000 bytes) in
/data1/albums/retreive.php3 on line 427

Actual result:
--------------
I checked the memory usage right before imagecreatetruecolor and it was
at 6.4M. The memory limit was set to 512M, script run under nice +11.

It crashes on imagecreatetruecolor.

But when I set the memory limit to 10000M it works ok and the code
above returns.

[16-May-2007 19:10:27] 6451636 500 - 375
[16-May-2007 19:10:27] 7405476 500 - 375

As you can see, the real memory usage raised only about 1MB instead of
hitting the upper limit of 500MB.

This happened only on some images. Don't know why.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41411&edit=1

Reply via email to