Re: PHP 4.0 Bug #5641: php module fails to release memory

From: Date: Mon, 17 Jul 2000 15:27:37 +0000
Subject: Re: PHP 4.0 Bug #5641: php module fails to release memory
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-24777@lists.php.net to get a copy of this message
RL>> Since PHP never terminates, your httpd processes will grow to RL>> the size of your most memory hungry script and stay there. That's is not exactly true. free() frees memory iff there's no memory blocks "above" this block and there's enough memory to free. Definition of "enough" depends on implementation. Also, large (more than 64K for glibc, IIRC) blocks are allocated with memmap(/dev/zero), so they are released immediately on free(). Unfortunately, PHP allocates memory often in small "chunks" and often, meaning there's not really many chances that memory will be returned to OS. But that's not too much problem since PHP will reuse this memory and PHP memory manager is build to never really "leak" memory. -- Stanislav Malyshev stas@zend.com +972-3-6139665

« previous php.dev (#24777) next »