! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Memory leak in sensors
Status:
RESOLVED: FIXED
Product:
Xfce4-sensors-plugin
Component:
General

Comments

Description Mihai stanescu 2007-03-27 12:06:08 CEST
[ I] sys-apps/lm_sensors (2.10.1):  Hardware Monitoring user-space utilities
[ I] xfce-extra/xfce4-sensors (0.10.0-r1):  lm_sensors and hddtemp panel plugin

I get about 140 MB of allocated RAM after 4 days of uptime and 3 secs refresh i think.
Comment 1 Nick Schermer editbugs 2007-03-27 14:07:59 CEST
Using g_strdup_printf in this plugin is completely wrong, you duplicate string all the time and they are not freed.
Please use GString instead. Like so:

GString *labeltext = g_string_new ("");

while (sensors)
  {
    g_string_append_printf (labeltext, "The temp is %d degrees", celcius);
    
    if (itemsToDisplay > 1)
      labeltext = g_string_append_c (labeltext, '\n');
  }

gtk_label_set_markup (GTK_LABEL(label), labeltext->str);
g_string_free (labeltext, TRUE);

I think that will make your live much easier and it removes all the leaks.
Comment 2 Yves-Alexis Perez editbugs 2008-02-26 16:29:31 CET
Is there some news about this? A debian user reported [0] that it could reproduce this leak (at least on 0.10.99.2).

[0]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440858
Comment 3 Fabian Nowak editbugs 2008-02-28 22:25:55 CET
(In reply to comment #2)
Most of the memory leaks have been worked on at 0.10.99.2 and 0.10.99.3 and more work still has to be done; I need more details to not waste my precious time on figuring out, which setups the people have been using under which circumstances (3 secs update does not make any sense at all, btw.) to produce such an enormous amount of memory usage.

Bug #3064

Reported by:
Mihai stanescu
Reported on: 2007-03-27
Last modified on: 2009-07-15

People

Assignee:
Fabian Nowak
CC List:
1 user

Version

Version:
unspecified

Attachments

Additional information