Bug 317961 - GTK apps in system tray leak X resources
Summary: GTK apps in system tray leak X resources
Status: RESOLVED DUPLICATE of bug 314919
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-systemtray (show other bugs)
Version: 4.10.2
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-07 01:40 UTC by Eevee
Modified: 2013-06-06 14:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eevee 2013-04-07 01:40:53 UTC
For many months now I've been experiencing significant graphical slowdowns in KDE, with the only quantifiable symptom being a ludicrously high "misc" count in xrestop for plasma-desktop—I start to get noticeable lag around 40k, but have caught it as high as 150k+.  Killing and restarting plasma-desktop alleviates the problem, but only temporarily.

At last I've found the culprit.  If a GTK+ app is in the system tray, and it changes its icon, a single X "picture" leaks.  I suspect a great many people are experiencing this, but few actually notice it.  I just happen to be running WhatPulse, a GTK+ keycounter that briefly changes its icon (to show a dot registering a counted key) /every single time/ I press a key or click a mouse button.

An easier demonstration is Pidgin:
1. Open a terminal and leave `xrestop` running.
2. Open Pidgin and sign into some account.  Enable Pidgin's system tray icon if necessary.  (Tools > Preferences > Interface > Show system tray icon: Always)
3. Find plasma-desktop in xrestop and watch its "misc" column; wait until the misc count stabilizes.
4. Change Pidgin's status to Away.  plasma-desktop's "misc" resource count increases by 1.
5. Change Pidgin's status back to Available.  plasma-desktop's "misc" resource count again increases by 1.

The "misc" count will never reclaim the old icon.  Perform this dance tens of thousands of times, and KDE will start to noticeably lag.  Disabling Pidgin's system tray icon, hiding Pidgin from the system tray, or removing the system tray from your panel altogether will avoid the leak.  Nothing else seems to help, and the only way to drop the count is to restart plasma-desktop.

As far as I can tell, this only happens with GTK+ apps.  Muting and unmuting the volume to change the KMix icon, for example, doesn't change the "misc" count at all.  But both Pidgin and WhatPulse reproduce the leak every time.

A similar issue occurs with `uim-toolbar-gtk-systray`: whenever I switch workspaces with the icon visible, one X picture leaks.  I'm not entirely sure why this is, but I'd guess that uim is resetting its icon during a workspace change for some reason.  Again, if I hide the uim icon (which somewhat defeats the purpose of having it), nothing leaks.

Arch Linux x86_64, KDE 4.10.2 (but observed on many versions going back possibly a year or more).  GTX 460 with the latest nvidia blob driver.  

Reproducible: Always
Comment 1 Jekyll Wu 2013-04-07 02:19:16 UTC

*** This bug has been marked as a duplicate of bug 314919 ***