! 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 !
Potential Power Manager Plugin Memory Leak
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description ToZ editbugs 2015-11-25 16:00:40 CET
This is related to https://bugzilla.xfce.org/show_bug.cgi?id=11538 (marked as resolved). I'm still seeing a slow leaking of RES memory from the power manager plugin. The following command shows the slow RES leakage:

top -p $(ps -ef | grep libxfce4power | grep -v grep | awk '{ print $2 }')


OS & version: ArchLinux (1.5.2git-4ed7c49) & Xubuntu 15.10 (1.4.4)


Also seen by one other person: https://forum.xfce.org/viewtopic.php?pid=39629
Restarting the panel re-sets the memory usage.


Will try to troubleshoot with valgrind when I have time.
Comment 1 James Shaw 2015-12-07 13:45:24 CET
I'm also seeing the leak having upgraded to xubuntu 15.10.  The top command suggested doesn't work for me because grep libxfce4power | grep -v grep returns nothing.  I used http://stackoverflow.com/a/12254656/150884 to find out that xfce4-power-manager has leaked ~2GB of swap.  As the forum post suggests, restarting the process is a workaround.  Is it worth filing an xubuntu bug, too?
Comment 2 Hyunho Cho 2015-12-17 17:24:44 CET
I have the same problems with xubuntu 15.10.
memory leak increase little by little and become huge
Comment 3 Eric Koegel editbugs 2015-12-21 17:09:47 CET
Created attachment 6564 
memory leaks

This patch should fix a couple memory leaks I found. It still looks like we might be leaking something when the icon actually changes (i.e. going from full power to on battery) but I stop seeing a leak when it's idle at full charge.

Would be nice if someone could verify it helps and that it doesn't cause any crashes/regressions.
Comment 4 ToZ editbugs 2015-12-22 02:14:11 CET
Thanks for the patch, Eric. I've been running it for the last 5 hours and it seems to mostly fix the issue. I still get a small bump when I hover the mouse over the indicator, but it seems to no longer leak memory like it did. I don't see the memory leaking when the icon changes on battery status.

I checked some of the other functionality and everything seems ok (other than the crashing when adjusting brightness which I've had for a while now - https://bugzilla.xfce.org/show_bug.cgi?id=12291 - which isn't related to this patch).
Comment 5 ToZ editbugs 2015-12-22 05:11:35 CET
Found one issue. The System Tray Icon no longer works when activated in the Power Manager Settings. It doesn't show up in the panel like it used to.
Comment 6 Eric Koegel editbugs 2015-12-27 07:56:04 CET
Created attachment 6571 
memory leaks

Good catch, this revision should fix that issue.
Comment 7 ToZ editbugs 2015-12-27 15:16:57 CET
Eric,
The patch does bring the icon back. However, regardless of the icon theme, the systray icon is always black in colour now. I have tried different icon themes, I disabled and re-enabled the systray icon after changing themes and restarted the panel. 

Here are some screenshots:

Pre-patch: http://en.zimagez.com/miniature/pre28.png
Post-patch: http://en.zimagez.com/miniature/post37.png

Thanks.
Comment 8 Eric Koegel editbugs 2015-12-28 14:15:26 CET
Created attachment 6572 
memory leaks

Weird, it was working fine for me until I started changing themes. This revision should fix that issue. Thanks for all the testing with this!
Comment 9 ToZ editbugs 2015-12-28 17:38:46 CET
Yes, this patch fixes the issue. No more apparent memory leakage as well. Thanks.
Comment 10 Eric Koegel editbugs 2016-01-04 05:00:50 CET
Thanks! Pushed to master in:
commit 6eaf8f868ed9ed8018385e16a92eaacef3c32a9d
Author: Eric Koegel <eric.koegel@gmail.com>
Date:   Mon Dec 28 16:12:00 2015 +0300

    plugin: Fix a couple memory leaks (Bug #12332)
    
    Found a couple spots where we inadvertently leak memory.
    
    Signed-off-by: Eric Koegel <eric.koegel@gmail.com>
http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=6eaf8f868ed9ed8018385e16a92eaacef3c32a9d

Bug #12332

Reported by:
ToZ
Reported on: 2015-11-25
Last modified on: 2016-01-04

People

Assignee:
Ali Abdallah
CC List:
5 users

Version

Attachments

memory leaks (3.48 KB, patch)
2015-12-21 17:09 CET , Eric Koegel
no flags
memory leaks (3.67 KB, patch)
2015-12-27 07:56 CET , Eric Koegel
no flags
memory leaks (3.27 KB, patch)
2015-12-28 14:15 CET , Eric Koegel
no flags

Additional information