ID: 36197 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Apache related Operating System: gentoo 2005.1 PHP Version: 5.1.2 New Comment:
Once PHP frees memory it is now up to the OS to make this memory available to other process. Memory managers on some OSes like Linux try to anticipate future use of memory by the same process and do not immidiately make the memory available. This however is no fault of PHP, nor is something PHP can do anything about. Previous Comments: ------------------------------------------------------------------------ [2006-02-02 15:21:47] [EMAIL PROTECTED] Good answer to another question. No, i don't won't to restrict the memory usage. i want use huge arrays and i also want the php to free the memory it use on the end of script. If that is not possible for some reason, please mark this bug as "won't fix" not bogus. ------------------------------------------------------------------------ [2006-02-02 15:05:29] [EMAIL PROTECTED] if you want to restrict memory usage use the memory-limit configuration option when compiling PHP. ------------------------------------------------------------------------ [2006-02-02 09:19:20] [EMAIL PROTECTED] Thank for the replay, but please read my question carefully. I know that php free the allocated by emalloc memory on the end of script, my question was why php don't do it for the memory that was allocated by the *php end user* just like the example i give above. Yes you can call it feature, and blame linux mm, but the fact that php do it for the memory used by the extensions developers, give me a hint that may there is simple way protecting the end user to not kill his server as well, especially when we talk about linux+apache 1.3.x that AFAIK it the most common configuration of production php web servers. (sorry for opening the bug again, if you will change the status of the bug to 'will not fix', i'll let him die) ------------------------------------------------------------------------ [2006-01-31 16:12:08] [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 PHP uses an internal memory memory manager, when you allocate memory using emalloc() it'll be freed at the end of the request, even if you don't free it explicitly yourself. ------------------------------------------------------------------------ [2006-01-30 12:24:33] [EMAIL PROTECTED] My apology of being nagger but the bellow code, use memory (even without inner free) that become free right after the script execution ending. is there a problem to get back the php varibles memory, just like the efree do? PHP_FUNCTION(momo_test) { char *some_memory; int a; some_memory = (char *) emalloc(0x4000000); for(a=0;a<0x4000000;a++) some_memory[a]=0; //efree(some_memory); } Can you send me more exact reference how the linux memory allocation responsible for this spend memory? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36197 -- Edit this bug report at http://bugs.php.net/?id=36197&edit=1