ID: 45296
User updated by: louis at steelbytes dot com
Reported By: louis at steelbytes dot com
Status: Bogus
Bug Type: Performance problem
Operating System: windows
PHP Version: 5.2.6
New Comment:
> but this is not a bug
what is it then?
why can't I use memory_get_usage() + ini_set('memory_limit',xxx) to
check for memory leaks in my code?
do I just give up and ini_set('memory_limit',4GigaBytes) and never give
a damn about memeory?
Previous Comments:
------------------------------------------------------------------------
[2008-10-28 13:26:33] [EMAIL PROTECTED]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2008-06-18 09:12:13] louis at steelbytes dot com
Description:
------------
the following code fails with
Fatal error: Allowed memory size of 587896 bytes exhausted (tried to
allocate 262145 bytes)
command:
php.exe -n -f memuse.php
memuse.php:
@ob_end_flush();
@ob_implicit_flush(1);
define('big_size',256*1024);
define('saftey',4*1024);
ini_set('memory_limit',memory_get_usage()+big_size*2+saftey);
$big = str_repeat('x',big_size);
yet if I change big_size to 1024*1024, then it works?
and a simlar script
@ob_end_flush();
@ob_implicit_flush(1);
define('big_size',200*1024);
define('saftey',4*1024);
ini_set('memory_limit',memory_get_usage()+big_size+saftey);
echo str_repeat('x',big_size);
also fails, yet if I change big_size to 180*1024 then it works?
PS, note that in the first script I set mem limit to 2 times big_size,
and in the 2nd script I did not.
Reproduce code:
---------------
see above
Expected result:
----------------
see above
Actual result:
--------------
see above
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45296&edit=1