|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-15 23:56 UTC] sniper@php.net
[2005-03-16 23:20 UTC] camka at email dot ee
[2005-03-17 09:44 UTC] sniper@php.net
[2005-03-17 17:35 UTC] camka at email dot ee
[2005-03-19 23:37 UTC] camka at email dot ee
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 21:00:01 2025 UTC |
Description: ------------ php compiled with --enable-memory-limit, but setting the value of memory_limit more then certain number won't affect scripts. tried set the value of memory_limit in both php.ini and script body - nothing helped. Reproduce code: --------------- <?php echo ini_get('memory_limit'),"\n"; ini_set('memory_limit', 100000000); echo ini_get('memory_limit'),"\n"; ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); function a() { echo 'fck oyu!'; } register_shutdown_function('a'); $zz = 'u'; for($i=1; $i<1000; $i++) { $zz .= $zz; echo $i,' - ', memory_get_usage(),"<br>\n";flush(); } ?> Expected result: ---------------- allocate at least 100MB of memory and die if exceeded. Actual result: -------------- 100M 100000000 1 - 12912<br> 2 - 12912<br> 3 - 12920<br> 4 - 12944<br> 5 - 12960<br> 6 - 13032<br> 7 - 13096<br> 8 - 13224<br> 9 - 13480<br> 10 - 13992<br> 11 - 15016<br> 12 - 17064<br> 13 - 21160<br> 14 - 29352<br> 15 - 45736<br> 16 - 78504<br> 17 - 144040<br> 18 - 275112<br> 19 - 537256<br> 20 - 1061544<br> 21 - 2110120<br> 22 - 4207272<br> 23 - 8401576<br> error_log: FATAL: erealloc(): Unable to allocate 16777217 bytes