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

From: Date: Tue, 01 May 2001 16:15:56 +0000
Subject: Re: PHP 4.0 Bug #8889 Updated: Memory is not being freed.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-53178@lists.php.net to get a copy of this message
Hi Brian! On Mon, 30 Apr 2001, Brian Foddy wrote: > Perhaps another possible solution is this... > For those 1 in 300 web hits that the developer knows is > going to use gobs of memory and assuming they can't > be re-engineered to use less (through temp files, etc), > create a simple function that is callable in PHP that > will cause the parent apache process to exit (if it doesn't > exist already) It will be immediately replaced by another much smaller > version ready to handle the remaining 299 web hits. like: // expesive memory processing .... function cleanup() { posix_kill (posix_getpid(), 15) || posix_kill (posix_getpid(), 9); } register_shutdown_function("cleanup"); eventually, in a auto_apend file, if all the scripts are eating much mem. IIRC, Posix support is compiled by default, so it looks like a nice workarround for the memory problem... I was wondering, could a SIGHUP to the current child make it to release the memory? TERM is a bit harsh. -- teodor

« previous php.dev (#53178) next »