After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 358294 - Gnome2::GConf leaks memory for all retrieved values
Gnome2::GConf leaks memory for all retrieved values
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Gnome2::GConf
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2006-09-29 13:06 UTC by Santeri Paavolainen
Modified: 2006-09-29 13:42 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Graph of memory usage of the test program (8.61 KB, image/png)
2006-09-29 13:08 UTC, Santeri Paavolainen
Details

Description Santeri Paavolainen 2006-09-29 13:06:23 UTC
The following simple program grows indefinitely in size:

  use Gnome2::GConf;
  $client = Gnome2::GConf::Client->get_default;
  $client->get("/apps/metacity/general/button_layout") while 1;

The simple fix is probably to add a DESTROY function to GConfValue.xs to release the underlying GConfValue when the perl value goes out of scope:

void
DESTROY(value)
    GConfValue * value
  CODE:
    gconf_value_free(value);

or something like that.
Comment 1 Santeri Paavolainen 2006-09-29 13:08:22 UTC
Created attachment 73630 [details]
Graph of memory usage of the test program
Comment 2 Santeri Paavolainen 2006-09-29 13:11:08 UTC
The test was run with Gnome2:GConf version 1.030, but I checked 1.040 sources and there was no DESTROY visible so its probably reasonable to assume the problem is present in 1.040 too.
Comment 3 Emmanuele Bassi (:ebassi) 2006-09-29 13:42:46 UTC
thanks, this should now have been fixed in HEAD.

I'll release 1.041 shortly.

2006-09-29  Emmanuele Bassi  <ebassi@gmail.com>

        * GConf.pm: Bump to 1.041.

        * xs/GConfValue.xs: Add a DESTROY function for removing
        the GConfValue structure, as it's not a GType, so we don't
        have all the convenient memory handling provided by the
        gperl bindings. (#358294, Santeri Paavolainen)