Re: memory allocation and de-allocation
| From: | Alan Knowles | Date: | Tue, 12 Mar 2002 11:39:12 +0000 |
| Subject: | Re: memory allocation and de-allocation | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1488@lists.php.net to get a copy of this message | ||
advice from up above (not me :)
try changing this in Zend/zend_alloc.c
#define MAX_CACHED_MEMORY 11 #define MAX_CACHED_ENTRIES 256#define PRE_INIT_CACHE_ENTRIES 32 to
#define MAX_CACHED_MEMORY 1 #define MAX_CACHED_ENTRIES 1#define PRE_INIT_CACHE_ENTRIES 1 - this should tell php to not cache the memory (dont forget that php assumes that another apache process may want to use that memory :) regards alan Brett Geer wrote:
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