ID: 37114 Updated by: [EMAIL PROTECTED] Reported By: virtuall at virtuall dot info Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux, Freebsd PHP Version: 5.1.2 New Comment:
This is not a bug... PHP caches some internal things. If you run this script you'll see it only "leaks" once... but it's just a cached allocation: <?php echo memory_get_usage(), "\n"; for ($i = 0; $i < 100; ++$i) { explode(' ', 'blah foo bar'); echo memory_get_usage(), "\n"; } ?> Previous Comments: ------------------------------------------------------------------------ [2006-04-18 07:51:05] virtuall at virtuall dot info Exactly, memory is freed in the end of script, but there is no way to free it in the runtime - and it's a disaster for highly loaded daemons (yes, I write daemons in PHP). Or are you trying to tell me it's not a bug? ------------------------------------------------------------------------ [2006-04-17 22:56:05] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Memory gets freed at the end the script. ------------------------------------------------------------------------ [2006-04-17 21:23:39] virtuall at virtuall dot info Description: ------------ It's a strange that nobody has noticed a memleak in such an essential function. This needs no comments, does it? Reproduce code: --------------- <?php echo memory_get_usage() . "\n"; explode(' ', 'blah foo bar'); echo memory_get_usage() . "\n"; ?> Expected result: ---------------- 40824 40824 Actual result: -------------- 40824 41120 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37114&edit=1