Re: PHP Memory issues in PHP5 as well?

From: Date: Fri, 26 May 2006 07:37:44 +0000
Subject: Re: PHP Memory issues in PHP5 as well?
References: 1 2 3 4  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-6952@lists.php.net to get a copy of this message
Mhh.. I stand corrected.. - I guess that changed since last time I looked.. php -r '$ar = array(); for($i=0;$i<1000;$i++) { $ar[] = str_repeat("xx", 1000); var_dump(memory_get_usage()); } $ar = false; var_dump(memory_get_usage()); ' Regards Alan Andrei Zmievski wrote: > That's not true. > > -Andrei > > > On May 26, 2006, at 4:28 AM, Alan Knowles wrote: > >> From what I remember you had to turn of the Zend memory manager to >> make it free memory. (changing the value of a flag in the Zend engine.) >> Regards >> Alan >> >> Christian Weiske wrote: >> >>> Benjamin, >>> >>> >>> >>>> But, based on this thread, that may well turn out to be a very bad >>>> idea, leading to stability problems. Are these memory issues (not >>>> freeing memory when allocated inside a function or PHP class >>>> object) also present in PHP5? >>> PHP5 does free memory when unsetting variables. >>> In fact, you can do this: >>> >>> while (true) { >>> $w = new GtkWindow(); >>> } >>> >>> In PHP-Gtk1 (with php4), you would fill up memory within seconds. In >>> PHP5 with PHP-Gtk2, memory usage stays low as the objects are deleted >>> when they aren't used any more. You also can use unset() to free >>> mem, now. >>> >>> >> >> --PHP-GTK General Mailing List (http://gtk.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > > --PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.gtk.general (#6952) next »