Re: PHP 4.0 Bug #8889: Memory is not being freed.

From: Date: Tue, 30 Jan 2001 09:42:00 +0000
Subject: Re: PHP 4.0 Bug #8889: Memory is not being freed.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-45348@lists.php.net to get a copy of this message
BM>> It is not a leak exactly but more of a greed. It seems to be a BM>> semi-intentional but not necessary thing. It seems that the way BM>> Zend/PHP is allocating memory is not allowing it to be returned BM>> to the system. Once PHP has some memory it will not let it go, BM>> but it will reuse it. So, if a script takes up a good chunk of BM>> memory, it is never returned to the system unless that httpd BM>> process is killed or dies. That effect was discussed to death already. Libc implementation of malloc does not return memory to the system unless some very special conditions are met (freed block is very large or there's enough consecutive free space at the top of the memory). Unless PHP switches to some non-standard malloc algoritm, it would be this way. As for PHP not freeing some meory block - it was done for purpose, and the purpose is - performance (I hope you don't think Zend authors have gone through all that trouble of having their own allocs just because they didn't think of using standard mallocs, right?). If memory size is more important for you than performance - you are free to turn this solution off. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115

« previous php.dev (#45348) next »