Open thanatos opened 7 years ago
(Looking through what I hope are likely sections to try to find my leak.)
First, this function; if the call on that line to g_io_channel_read_line_string
fails, it will allocate a GError and store a pointer to it in gerror
; AFAICT, it is on us to call g_clear_error
, which we never do (thus leaking the error should one occur). (We also ignore the return code from g_io_channel
, so the requisite error handling is missing altogether from this function.)
Trying to compile mate-applets (for debug mode, to see if I can give it to valgrind), but it seems like it requires libmatepanelapplet >= 1.17.0,
configure: error: Package requirements (libmatepanelapplet-4.0 >= 1.17.0) were not met:
Requested 'libmatepanelapplet-4.0 >= 1.17.0' but version of libmate-panel-applet-4 is 1.16.0
My distro, Arch, has 1.16 as the latest version, AFAICT.
I have the same issue (the leak). The process is using ~500MiB of ram after an uptime of 11 days.
Can you try the above commit? See if that helps.
in 2 weeks battstat-applet grew to use 1.7GB of RAM
to be fair I have 2 of these in use - one to show battery % and the other to show time
@thanatos: if you need to rebuild the current stable release of mate-applets, you'll need to checkout to 1.18 branch first. Or just use one of tarballs.
I Built master this morning which contain the possible fix, replaced the os installed binary with the built one and reboot.
I don't know why but with the built one, the settings menu option is not there. Anyway, it looks to still leak since It grow from 81Mb to 91Mb in few hours.
If you tell me how I can debug that, I can leave it running few days and dump/debug.
You can use valgrind, though I don't know if it could be attached to a running process (similar to gdb).
This has been annoying me for 5 months now so today I finally removed it from my panel. For those who aren't sure which applet that is:
top
, for example - if it's bothering you, it's likely at the top)sudo kill -9 $PID
I switched to using this poor man's battery indicator script based on https://askubuntu.com/questions/69556/how-to-check-battery-status-using-terminal. I have 2 batteries.
#!/bin/bash
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|to\ full|percentage"
upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep -E "state|to\ full|percentage"
It seems the issue is still present. My laptop has been up for a month and battstat-applet is using more memory than my browser.
Still present in Ubuntu 18.04
I am running Ubuntu 18.04.4 LTS, and I have an interesting issue with this applet.
I keep running my laptop for days in a row, but I put it to sleep overnight. Sometimes, when I wake it up, or perhaps when I connect the power cord (I do not know yet which one of these 2 actions is triggering this issue), then battstat-applet starts consuming a lot of CPU power. I can hear how the laptop fan starts running faster. I think it is using 1 CPU core at 100 %. That is process /usr/lib/mate-applets/battstat-applet .
Memory consumption is rather high, over 500 MiB of memory and over 1 GiB of virtual memory, according to MATE's "System Monitor" tool. That would be the reported memory leak. I wonder if that triggers the high CPU usage too, or if that is something entirely different.
If I kill battstat-applet, I can choose to have it restarted, and then it works fine. Until next time.
There is one more thing to report. Because I did not like the battery icon, especially the little "plug" icon when the power cord is connected, I tried briefly with another applet called "Battery Charge Monitor", but I removed it (or so I believe). The battery charge indicator is now showing in the standard "Indicator Applet Complete" version 1.20.0.
However, this battstat-applet is probably not part of the "Indicator Applet Complete", but it is in fact the "Battery Charge Monitor" applet. I think that it does not show its taskbar icon most of the time. Can someone confirm this?
How do I inspect all the applets that the panel is actually loading or trying to load? I think in earlier versions of MATE there was a panel dialog where I could see and reorder all applets, but that is now gone. It is now hard enough to find a very narrow strip on the taskbar where I can right-click and get the Panel's pop-up menu with the "+ Add to Panel" option. Right-clicking on most of the taskbar space just shows the pop-up menu for a particular applet.
All in all a rather unsatisfactory state of affairs.
@rdiez maybe this is a red herring, but I have two battery indicators running as well
Why do you have two?
If I remember well, I tried to add the standalone "Battery Charge Monitor" / battstat-applet because the main battery indicator on the "Indicator Applet Complete" stopped working (disappeared). But it appeared again later on by itself. This is a laptop, it always has a battery (it is in fact nondetachable).
Why do you have two?
If I remember well, I tried to add the standalone "Battery Charge Monitor" / battstat-applet because the main battery indicator on the "Indicator Applet Complete" stopped working (disappeared). But it appeared again later on by itself. This is a laptop, it always has a battery (it is in fact nondetachable).
Exactly because of this, the indicator kept crashing? / disappearing so I added another
The battstat applet on my system is consuming 11% of RAM, or 3.6 gigabytes:
(It has also used a considerable 9h of CPU time, out of 39 days of uptime; currently, only Chrome and X11 have used more.)
I'll keep the leaker in RAM for a while longer, so if there's any debug info from the running process I can attach, let me know. We'll be using swap soon, so at some point, I'll have to kill it.