Re: PHP4: php_module holds memory to long !

From: Date: Thu, 11 Jan 2001 17:58:13 +0000
Subject: Re: PHP4: php_module holds memory to long !
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-43796@lists.php.net to get a copy of this message
> The reason is that httpd memory usage patterns significantly differ from > your simple example. E.g., there might be some memory block allocated at > the end of the heap, which is not freed at the end of the request - and it > will prevent all the rest of memory from being returned to the system. Don't blame "httpd memory usage patterns" ! Of course they differ from my simple example, but... I've changed "a bit" files Zend/zend_alloc.c and ...h files. I've just replaced the definitions of _emalloc, _efree... functions with simple #defines, linking them back to standard malloc, free... and so on functions. The compilation - went OK (I suppose, debug can not be set). The apache restart - OK. Testing php - .... - OK ! And the memory holding problem disapeared ! Memory is beeing returned to system as the script finishes. So... It is not a good solution, of course, because Zend memory optimaliser is turned off. But now we know, where should be put some afford to fix the problem. The optimaliser propably leaves only some memory blocks unfreed, but they make it unposible to return rest of memory back to system. Am I not right ? May be not... I send the changed files, but I suggest not to use them... For example replacement of function _persist_alloc with value 1 is very ... hmm... controversial ? It should return the size of block (as I suppose), but it was difficult to do that by simple means.

« previous php.dev (#43796) next »