Re: Wierd error

From: Date: Thu, 17 Nov 2005 16:21:41 +0000
Subject: Re: Wierd error
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-225995@lists.php.net to get a copy of this message
We were using unset() for the longest time but found it doesn't seem to free up the memory.
interesting - you are suggesting that settype does free the memory directly?
Yes. Moreso than unset(), at least according to my observations and tests.
I have seen a number of posts to internals regarding to being able to free up memory in long-running/heavy cli scripts... none of the devs mentioned settype() ... maybe you know something nobody else does :-)
We have a very process intensive script that creates (and destroys) a large number of objects. As this script gets run again and again, we would see that the memory load would go through the roof and eventually cause Apache to crash (among other things; btw - this is running on a windoze box). We changed all the unset() to settype() and the memory usage over the same amount of time dropped dramatically - significantly, in fact. thnx, Chris

« previous php.general (#225995) next »