Bug 201718 - Kwin composite desktop effects memory leak
Summary: Kwin composite desktop effects memory leak
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-28 00:55 UTC by Yvan Da Silva
Modified: 2012-04-09 07:11 UTC (History)
0 users

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 Yvan Da Silva 2009-07-28 00:55:11 UTC
Version:            (using KDE 4.2.98)
OS:                Linux
Installed from:    Ubuntu Packages

The bug is quite easy to repeat.

Go to kde system settings and then desktop settings.

Check how much memory kwin is using normally around 19mb~

Disable desktop effects apply.
Enable desktop effects apply
(ALT+SHIFT+F12 if you have the shortcut does it too)

Check now how much memory kwin is using, for me kwin was using 30mb~

Opengl backend
Independ from OpenGL mode used "pixmap or shared memory"
8600M GT 
(No matter what the driver is used, I'm always changing)
The plug-ins doing this are the following in order of "memory usage after turn off/on" from low to high. 
"Translucency" really few mb used, but well it's a memory leak anyway (around 1mb by off/on switches).
"Desktop Cube" I go from 19mb to 29mb.
"Logout plugin" very high memory usage(Corrected on the other bug report)
https://bugs.kde.org/show_bug.cgi?id=201445

If this plugins are deactivated it helps a lot but, there's something more that I can't find what it is.

Because even with this plugins turned off there's something eating each time around more 1mb by switches of composite effects.
When I do not check in general tab the "Improved window management" then there's no more memory leak.
Comment 1 Martin Flöser 2009-07-28 14:06:53 UTC
(In reply to comment #0)
> "Desktop Cube" I go from 19mb to 29mb.
Thanks for investigating. For me it's not increasing that much. What I noticed: it increases if you use a cubecap image as that is loaded once and kept in memory (and Mipmaps are generated). That could be changed, but it's a tradeoff: if it's loaded when the effect starts, it will probably be noticed. Well we don't know without trying ;-)

While watching I noticed something more: when activating cube for the first time memory increases about 1 MB which isn't reset after end of effect. But further activation does not increase memory usage any more. No idea yet what is causing it. My fair guess is some OpenGL variable which isn't freed.
Comment 2 Yvan Da Silva 2009-07-28 14:28:02 UTC
That's kind of strange, because I use plugins unmodified and well it's the default image of kubuntu on top on my cube.

But anyway it should not go from 19mb to 30 ! It's quite insane...
I mean even with a png about 1 or 2 mb I presume it would not make this increase like that.
Something else is doing this.
Comment 3 Thomas Lübking 2009-07-28 14:43:16 UTC
the images aren't stored compressed ;-P

@martin: do you really think that cubcaps are worth mipmapping? (whether on performance or image quality) -> why not just load the image and create a dumb 256x256 or 512x512 texture... ;-P
Comment 4 Martin Flöser 2009-07-28 14:55:28 UTC
(In reply to comment #2)
> That's kind of strange, because I use plugins unmodified and well it's the
> default image of kubuntu on top on my cube.
> 
> But anyway it should not go from 19mb to 30 ! It's quite insane...
> I mean even with a png about 1 or 2 mb I presume it would not make this
> increase like that.
> Something else is doing this.
I'm using default Kubuntu image as well. And as I said I don't have an increase of 10 MB. What's your graphics card and driver, btw?

@ Thomas: I thought about it and yes I think it's worth to do mipmapping, because the cap get's scaled and we don't know how big the cube is. And I don't think it's that worse in memory. The kubuntu default image has something about 300 K. So even mipmaps can't be that big.
Comment 5 Yvan Da Silva 2009-07-28 15:02:20 UTC
I don't have time to test it right now I'm leaving so 
here is my nvidia driver version : 185.18.14 (x86_64)
Comment 6 Martin Flöser 2012-04-09 07:11:37 UTC
That bug has been reported for a nowadays unmaintained version. It is unlikely that any findings of this bug report are still valid.

For memory leak issues the best way to help is provide a valgrind dump to see where we leak, but we have not had complaints about leaks for quite some time :-)