#41411 [NoF->Bgs]: imagecreatetruecolor memory break?
| From: | pajoye@php.net | Date: | Tue, 17 Jun 2008 21:19:08 +0000 |
| Subject: | #41411 [NoF->Bgs]: imagecreatetruecolor memory break? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125833@lists.php.net to get a copy of this message | ||
ID: 41411
Updated by: pajoye@php.net
Reported By: eth at ethaniel dot com
-Status: No Feedback
+Status: Bogus
Bug Type: GD related
Operating System: Linux FC 6 2.6.18
PHP Version: 5.2.2
-Assigned To:
+Assigned To: pajoye
New Comment:
I suppose you are uploading an image as well?
But there is no such bug in imagecreatetruecolor, really not.
Previous Comments:
------------------------------------------------------------------------
[2008-06-17 20:34:09] anonymous at anonymous dot com
Upgrade to 5.2.6.
------------------------------------------------------------------------
[2007-05-24 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2007-05-16 18:33:17] tony2001@php.net
./sapi/cli/php -r 'var_dump(memory_get_usage()); $newImg =
ImageCreateTrueColor(500, 375); var_dump(memory_get_usage());'
int(88476)
int(1069836)
------------------------------------------------------------------------
[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