! 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 !
High RAM usage after a few days
Status:
RESOLVED: FIXED
Product:
Xfce4-sensors-plugin
Component:
General

Comments

Description emoryy 2017-01-13 14:49:46 CET
Created attachment 6957 
htop screenshot

I noticed that xfce4-sensors-plugin is using quite a big amount of RAM.
According to htop it has accumulated 1.2G of RAM after 11 days.
Plugin version 1.2.6
Comment 1 Gokturk Yuksek 2017-03-23 21:03:51 CET
15GB after 96 days uptime here as well
Comment 2 Fabian Nowak editbugs 2017-03-24 21:16:15 CET
(In reply to Gokturk Yuksek from comment #1)
> 15GB after 96 days uptime here as well

Which version, please? 

Using the display style "bars" with the progress bars? There is a problem in Gtk 3 with the CSS styles when updating too fast; a fix is already in upstream. Should only occur with 1 s refresh interval?
Comment 3 Gokturk Yuksek 2017-03-24 23:53:12 CET
I am using the xfce4-sensors-plugin-1.2.6 and gtk+-3.20.9 in Gentoo Linux. I've started xfce4-sensors with valgrind and ran it over a day using 1s refresh interval. valgrind still hasn't finished processing the allocations, currently this is all I have:

  ==3199== HEAP SUMMARY:
  ==3199==     in use at exit: 2,232,569,821 bytes in 35,494,640 blocks
  ==3199==   total heap usage: 611,127,407 allocs, 575,632,767 frees, 32,113,214,261 bytes allocated

Note that the original leak was reported for the sensors panel plugin, while the valgrind results are for the xfce4-sensors binary. I will update the bug once it finishes processing. Do you know which version of gtk+ contains the upstream fix?
Comment 4 Fabian Nowak editbugs 2017-03-25 21:52:15 CET
(In reply to Gokturk Yuksek from comment #3)
> I am using the xfce4-sensors-plugin-1.2.6 and gtk+-3.20.9 in Gentoo Linux.
> I've started xfce4-sensors with valgrind and ran it over a day using 1s
> refresh interval. valgrind still hasn't finished processing the allocations,
> currently this is all I have:
> 
>   ==3199== HEAP SUMMARY:
>   ==3199==     in use at exit: 2,232,569,821 bytes in 35,494,640 blocks
>   ==3199==   total heap usage: 611,127,407 allocs, 575,632,767 frees,
> 32,113,214,261 bytes allocated
> 
> Note that the original leak was reported for the sensors panel plugin, while
> the valgrind results are for the xfce4-sensors binary. I will update the bug
> once it finishes processing. Do you know which version of gtk+ contains the
> upstream fix?

OK, thanks for the details. You don't use the newer versions 1.2.97 or similar and you dont't use the bars setup. So the CSS problem with Gtk doesn't affect you. Though, the problem can easily be fixed by the application programmers, for the xfce 4 sensors goodie, the fix is in git.

This said, there have been more fixes towards memory leaks; optimizations with refreshing the tacho widgets. Though, there still seems to be a memory corruption issued, and I would like to wait until I get that fixed before releasing 1.2.98.

As a side note, the standalone app is more of a testing tool for the tacho widgets, with far from suboptimal tacho refreshing code. In case people really use it, I will invest more time in this tool.

Whenever you help in tracking down the problems, you really don't have to run the plugins or applications for lots of hours. Few minutes with update interval of 1s should really suffice.
Comment 5 Gokturk Yuksek 2017-03-26 03:54:26 CEST
Created attachment 7057 
Valgrind log

I've attached the full log. I used the standalone app precisely to run with valgrind, normally I use the plugin. I ran it for long because I didn't know whether the standalone app will also have leaks.
Comment 6 Fabian Nowak editbugs 2017-03-26 22:37:14 CEST
(In reply to Gokturk Yuksek from comment #5)
> Created attachment 7057 
> Valgrind log
> 
> I've attached the full log. I used the standalone app precisely to run with
> valgrind, normally I use the plugin. I ran it for long because I didn't know
> whether the standalone app will also have leaks.

Thanks anyway, I had already fixed most of the memory issues with sensors-plugin version 1.2.97 and the checkins since then. I am currently analyzing the current work as in git repository. However, the sensors application doesn't have proper cleanup code when shutting down and as a result will always report memory leaks with valgrind. So, it is more helpful to valgrind the plugin itself by modifying the .desktop file and analyze then – my next task.
Comment 7 Fabian Nowak editbugs 2017-03-29 22:32:27 CEST
CPU usage has been high with version 1.2.96 due to the way that the sensors plugin used the CSS capabilities of Gtk 3. At each refresh point, a new CSS style had been allocated; now the old one is reused.

Since older versions (1.2.6 or similar), there also seems to persist a problem when refreshing at a high rate and employing libsensors. This isn't solved as of now.

For further guesses and analyses, I need the config files and Xfce, panel and Gtk versions in addition to the plugin version, please.


Memory usage has also "sunken" with the checked-in code, i.e., it doesn't increase all the time now as it seems: 

pid=29702 user       20   0  403800  34068  25796 S   2,0  1,1   7:52.65 panel-25-xfce4-             

If you should still encounter too much memory usage, please copy the output from top as above or at least provide the consumed execution time such as 7 minutes 52 seconds above so that I can get a better view.
Comment 8 Fabian Nowak editbugs 2018-10-15 23:35:33 CEST
No more reports on memory consumption issues after the 1.2.98 and 1.3.0 releases.

Bug #13289

Reported by:
emoryy
Reported on: 2017-01-13
Last modified on: 2018-10-15

People

Assignee:
Fabian Nowak
CC List:
2 users

Version

Version:
unspecified

Attachments

htop screenshot (11.55 KB, image/png)
2017-01-13 14:49 CET , emoryy
no flags
Valgrind log (126.15 KB, text/plain)
2017-03-26 03:54 CEST , Gokturk Yuksek
no flags

Additional information