memory allocation and de-allocation
| From: | Brett Geer | Date: | Tue, 12 Mar 2002 07:59:00 +0000 |
| Subject: | memory allocation and de-allocation | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-1487@lists.php.net to get a copy of this message | ||
Porting one of my apps to php-gtk from the web interface I noted that the memory usage
of the app just kept on going up, after a little digging I discovered:
<?
function allocate_some ()
{
for ($loop = 0; $loop <= 100000; $loop++)
$some_array [$loop] = "This is a string to use up space";
}
?>
will grab a chunk of memory and not release it until script completion, I've tried
pop'ing the array and unset'ing the array and even setting the array to a null
with $some_array = NULL
With no success. Is there any way to free the memory from a variable, most of my
program runs with little memory usage, however one or two functions pull back
big lists of data.
brett