Re: Memory issues

From: Date: Mon, 13 Dec 2004 03:20:10 +0000
Subject: Re: Memory issues
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5343@lists.php.net to get a copy of this message
Hrm, I wrote a bunch about this for the manual under GtkObject about 18 months ago, but it doesn't seem to have made it as far as CVS (?) Basically the way it pans out is that you aren't freeing memory when you use destroy(), either in PHP 4 or in GTK 1.2.*/1.3 (for which read, in PHP-GTK 1) Experiments with early PHP 5 builds (alonga GTK 1) were noticeably faster on win32. We're still on 'wait and see', but I'd expect PHP-GTK 2 (aka PHP 5 + GTK 2) to speed along, comparatively. It's neither purely a PHP 4 problem nor purely a GTK 1 problem, but both dev teams have made some inroads into minimizing memory usage. HTH - Steph ----- Original Message ----- From: "Nghia" <nghia.ho@norwood.com.au> To: <php-gtk-general@lists.php.net> Sent: Monday, December 13, 2004 3:08 AM Subject: [PHP-GTK] Memory issues > Hi, > > Does anyone know how memory allocation/deallocation work with PHP-GTK? It > seems that the memory usuage just keeps increasing even when I'm sure I've > freed up memory via destroy() on the widgets. This happens on a Windows > 98/XP machine. > > Heres a really simple example > > <?php > if (!extension_loaded('gtk')) > dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); > > function button_press() > { > $dialog = &new GtkDialog(); > $dialog->show_all(); > $dialog->destroy(); > } > > $window = &new GtkWindow(); > $button = &new GtkButton("Dialog"); > $button->connect('clicked', 'button_press'); > > $window->add($button); > > $window->show_all(); > > Gtk::main(); > ?> > > Just keep clicking the button and the memory will start to increase rather > than remain constant as I would expect. > > Nghia > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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