ID: 32689 Updated by: [EMAIL PROTECTED] Reported By: jerome at kingofsofa dot org -Status: Open +Status: Bogus Bug Type: Performance problem Operating System: linux PHP Version: 5.0.4 New Comment:
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 This is caching - and expected - it will only go up until a certain point. Previous Comments: ------------------------------------------------------------------------ [2005-04-13 01:10:53] jerome at kingofsofa dot org Description: ------------ I think I have found a memory leak in php 4 and 5 depending on the size of the string concatenated to a variable a few bytes of memory are lost. See attached code. I have noticed that if you replace echo "instance $i "... by a "smaller" sentence echo "i $i " then the leak is not there. Since it has been there for a while I was wondering if this is actually an expected behavior. If so how should I do to avoid this. This is part of a script running constantly and calling some trace function that end up doing an echo. Reproduce code: --------------- for( $i = 0; $i < 100 ; $i++ ) { echo "instance $i ".memory_get_usage()."\n"; } echo "-------------------------------------------\n"; for( $i = 0; $i < 100 ; $i++ ) { echo "instance "; echo $i; echo " ".memory_get_usage()."\n"; } Expected result: ---------------- Content-type: text/html X-Powered-By: PHP/5.0.4 instance 0 40248 instance 1 40264 instance 2 40264 instance 3 40264 instance 4 40264 instance 5 40264 instance 6 40264 instance 7 40264 instance 8 40264 ... instance 99 40264 ------------------------------------------- instance 0 40264 instance 1 40280 instance 2 40280 instance 3 40280 instance 4 40280 instance 5 40280 instance 6 40280 Actual result: -------------- Content-type: text/html X-Powered-By: PHP/5.0.4 instance 0 40248 instance 1 40288 instance 2 40304 instance 3 40320 instance 4 40336 instance 5 40352 instance 6 40368 instance 7 40384 instance 8 40400 ... instance 99 41856 ------------------------------------------- instance 0 41856 instance 1 41872 instance 2 41872 instance 3 41872 instance 4 41872 instance 5 41872 instance 6 41872 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32689&edit=1