Re: Memory leak problem
| From: | Steph | Date: | Mon, 15 Jul 2002 15:00:16 +0000 |
| Subject: | Re: Memory leak problem | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2250@lists.php.net to get a copy of this message | ||
Yann, hi,
yep, these are both the same problem :)
There are issues in the Zend engine which are being addressed in ZE2
development. Currently there's no means of releasing an object's memory
until the script ends, so anything involving a lot of redraws is not a
good thing.
Basically this is being dealt with, but you're unlikely to see the
fruits of it until PHP-GTK2 is released.
----- Original Message -----
From: "Yann Le Guennec" <yann@e-sax.com>
To: "php-gtk" <php-gtk-general@lists.php.net>
Sent: Monday, July 15, 2002 12:59 PM
Subject: [PHP-GTK] Memory leak problem
> I just started using Php-Gtk, but I already know Gtk+.
>
> Here is a small script I wrote and for every three clicks on
> the drawing area, the script grows by about 4Kb of memory.
>
> Is there something wrong with the code or is there
> a problem with the php-gtk library ?
>
> There also seems to be no way to destroy a drawing area.
> A script like the scribble.php shipped with the php-gtk distribution
> make the X server go burst in about 30s to 1min of resizing.
> Because it creates a new drawing area for each resize event,
> without releasing the previous one.
> (Note: I have 512Mb of memory plus about the same in swap,
> that should be enough to run the scribble ;-)
>
> Version : PHP 4.2.1, PHP_GTK 0.5.1
>
> Yann.
>
> --------------------------------------------------------------
> #!/usr/bin/php
> <?
> if (!class_exists('gtk')) {
> if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
> dl('php_gtk.dll');
> else
> dl('php_gtk.so');
> }
>
> function button_press($object,$event)
> {
> };
>
> $draw = &new GtkDrawingArea();
> $draw->connect('button_press_event', 'button_press');
> $draw->set_events( GDK_BUTTON_PRESS_MASK );
> $draw->show();
>
> $win = &new GtkWindow();
> $win->set_title('Leak test');
> $win->set_usize(600,250);
> $win->connect_object('destroy', array('gtk','main_quit'));
> $win->add($draw);
> $win->show();
>
> Gtk::Main();
> ?>
> -------------------------------------------------------------
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>