Bug 110873 - Memory Leak in kdesktop with "Multiple Backgrounds" enabled
Summary: Memory Leak in kdesktop with "Multiple Backgrounds" enabled
Status: CLOSED FIXED
Alias: None
Product: kdesktop
Classification: Miscellaneous
Component: wallpaper (show other bugs)
Version: 3.4.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-16 11:28 UTC by Philip Blatter
Modified: 2009-01-02 20:31 UTC (History)
4 users (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 Philip Blatter 2005-08-16 11:28:46 UTC
Version:           3.4.1 (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          gcc 3.3.5-20050130 (Gentoo) CFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer"
OS:                Linux

I use the multiple backgrounds feature with an interval of 1 minute. Each time the background changes the memory usage of kdesktop grows up. This is reproduceable on my system.

Ive top'ed my system to visualize the process:

When kdesktop has initially started:
17376 xxx  15   0 31539  17m  14m S  1.4  2.2   0:01.07 kdesktop

After 20 min:
17376 xxx  15   0 66312  52m  14m S  0.8  6.7   0:23.21 kdesktop

After 1 hour:  (kdesktop eates more than 12% of my total system memory - 768M)
17376 xxx  15   0  113m  94m  14m S  0.0 12.5   1:17.26 kdesktop


The Memory usage is greater than 1 GB after one day running kdesktop.

Versions of Libs an Applications:
glibc: 2.3.5
Qt: 3.3.4
KDE: 3.4.1
KDesktop: 3.4.1
XOrg: 6.8.2 using stock "ati" driver


Best regards and thanks for the all the great work

Philip
Comment 1 Kurt Hindenburg 2005-12-18 06:37:35 UTC

*** This bug has been marked as a duplicate of 98597 ***
Comment 2 Philip Blatter 2005-12-18 23:17:28 UTC
I dont think, its a duplicate. In 98597 Xs Memory Usage is growing. In this Bug, kdesktop is growing.
Comment 3 Philip Blatter 2005-12-18 23:18:02 UTC
reopened
Comment 4 Frank Lin 2006-01-12 14:41:19 UTC
Confirmed with KDE 3.5 on Slackware 10.2. 

kdesktop consumes about 400M memory, using 1 minute multiple background, in around 6 hours. 

"killall kdesktop" reclaims the lost memory immediately. 

I will post memory data when I collect some.

Comment 5 Frank Lin 2006-01-15 01:00:15 UTC
After four hours:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
28223 frank     16   0  313m 286m  10m S  0.0 28.4   3:42.05 kdesktop


Restarted:
32250 frank     15   0 43708  25m  10m S  0.0  2.6   0:04.56 kdesktop
Comment 6 Alexander Runge 2006-05-08 13:20:33 UTC
Same here with two Gentoo installations. One is KDE 3.4.1 and proprietary ATI driver, the other is 3.5.2 with proprietary nvidia driver.
No problems when I set the background to plain color. Havn't tried a single wallpaper yet. As soon as I use multiple wallpapers on any system kdesktop starts eating memory. Normally around 100MB per day.
I reported this on bugs.gentoo.org, but they told me this had to be an upstream issue.

Regards, Alex!!!
Comment 7 Ernst Bachmann 2006-08-23 16:56:06 UTC
I have the same issue, but am not using the multiple (slideshow) backgrounds.

Instead I have a lots of different (svg & png) backgrounds on all screens (xinerama dual-head setup), all scaled to fit the screen size.

I suspect in my case the memory leaks whenever the resoltion is changed using the xrandr extension, e.g. when a game switches the second monitor off to run fullscreen.

KDE version is 3.5.4, QT 3.3.6, xorg-x11 7.0.0, nvidia drivers.

/Ernst
Comment 8 Andreas Kling 2006-09-16 21:28:36 UTC
Is everyone with this problem using SVG wallpapers? If so, it may have been fixed by revision 584936. See also bug 108326.
Comment 9 Andreas Kling 2006-09-18 23:55:12 UTC
SVN commit 586166 by kling:

Fixed gargantuan memory leak with SVG wallpapers.
Turns out KSVGIconEngine::image() returns a `new QImage'.

BUG: 110873


 M  +3 -1      bgrender.cpp  


--- branches/KDE/3.5/kdebase/kcontrol/background/bgrender.cpp #586165:586166
@@ -361,7 +361,9 @@
 	    }
 
 	    if (svgEngine->load(svgWidth, svgHeight, file )) {
-		m_Wallpaper = ( *svgEngine->image() );
+		QImage *image = svgEngine->image();
+		m_Wallpaper = *image;
+		delete image;
 	    } else {
 		kdWarning() << "failed to load SVG file " << file << endl;
 	    }
Comment 10 FiNeX 2009-01-02 20:31:18 UTC
Bug closed. Kdesktop is no more mantained.