Created attachment 17739 [details]
Valgrind log, when loading Amarok's Cover Manager.
I have been using xserver, mesa, drm, xf86-video-ati and various dependencies from git since 3d support for r500 cards was merged into master.
I *only* use KDE 4, no compiz.
I have always been experiencing memory leaks in two cases:
- With "Desktop Effects" enabled, minimizing/maximize a window takes about 4mb ram each time, like I explained in this bug (which I don't know if it's the same): http://bugs.freedesktop.org/show_bug.cgi?id=16316
- In Amarok 2.0-SVN, go Tools -> Cover Manager: while loading the thumbnails of the album covers in my collection, X eats *huge* amounts of ram. When it's done loading, X has taken more than 1GB ram (but this of course depends on how many albums are in the collection).
I've always had these leaks, so it's not a recent bug. I hoped this would eventually fix by itself, but I guess it didn't.
I'm not sure the valgrind log I attached is any useful, because it has way too many errors that occur as X starts, so even before the leak is triggered.
This is my VGA:
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X1400 (prog-if 00 [VGA controller])
Please let me know what I can to provide useful information to solve this!
KDE 4 with compositing or without? If with, using XRender or OpenGL? Does changing between these three options have any impact on the observed leaks?
Note that the valgrind log doesn't seem to show any such huge leaks, so it's possible these are actually server resource leaks in the clients. If you restart kwin4 or Amarok, does the X server memory usage go down or at least stop growing for a while?
The first one happens only with Composite enabled (Desktop Effects). And it seems to happen only with openGL. But xrender isn't an option since it's much.
The second happens both with Composite enabled or disabled.
Would it help if I run valgrind on Amarok instead?
But I doubt it's an amarok bug, otherwise I think people would have reported it, since it really trashes the whole system..
If I quit amarok or kwin the ram is still used by the X process.
*much slower, I meant.
The compositing minimize/maximize leak should be fixed with the xserver commit below, which has also been merged to the 1.5 branch.
It's unlikely to help for the Amarok leak though, so that probably needs more investigation. E.g. by running the X server from memprof, you could get a leak summary while the X server is still running.
Author: Kristian Høgsberg <firstname.lastname@example.org>
Date: Mon Jul 21 15:28:50 2008 -0400
Fix embarrasing GLXPixmap leak.
Thanks Michel, the leak appears to be gone indeed.
About memprof, is there another tool like it? Because memprof depends pretty much on gnome (gconf and libgnomeui), and I rather not install that :)
(In reply to comment #5)
> About memprof, is there another tool like it?
No idea I'm afraid.
> Because memprof depends pretty much on gnome (gconf and libgnomeui), and I
> rather not install that :)
Suit yourself. :)
This is still valid with xorg-server 1.5.3
I just tried a Ubuntu 8.10 liveCD.
The problem is still present.
Install Amarok 2.0 and click on the cover manager: Xorg starts eating ram like crazy.
How do I use memprof to launch X if memprof requires X to run?
(In reply to comment #8)
> How do I use memprof to launch X if memprof requires X to run?
From a remote login with ssh X forwarding.
I do experience the same bug and opened a bug report on Launchpad:
How could I help developers with appropriate informations?
Finally, after almost a year, someone hit the same bug :D
I started thinking there was something wrong with both my PCs.
Antoine, since valgrind output isn't useful you should use memprof to gather more info, but I haven't been able to use it successfully.
(In reply to comment #11)
> Finally, after almost a year, someone hit the same bug :D
> I started thinking there was something wrong with both my PCs.
> Antoine, since valgrind output isn't useful you should use memprof to gather
> more info, but I haven't been able to use it successfully.
I tried to find informations regarding the usage of memprof. The problem is the project seems quite old (unmaintained?) and no package is available for Ubuntu in Jaunty Jackalope. I therefore pulled the sources from ftp.gnome.org and tried to build it but I was unsuccessful.
While ./configure is alright, make fails...
stack-frame.c: In function 'mi_call_with_signal_backtrace':
stack-frame.c:155: error: 'stack_frame' undeclared (first use in this function)
stack-frame.c:155: error: (Each undeclared identifier is reported only once
stack-frame.c:155: error: for each function it appears in.)
stack-frame.c:155: error: 'frame' undeclared (first use in this function)
stack-frame.c:159: warning: left-hand operand of comma expression has no effect
stack-frame.c:159: warning: value computed is not used
stack-frame.c:161: warning: implicit declaration of function 'next_frame'
stack-frame.c:161: warning: left-hand operand of comma expression has no effect
stack-frame.c:161: warning: value computed is not used
stack-frame.c:163: warning: implicit declaration of function 'frame_return_address'
stack-frame.c:163: warning: initialization makes pointer from integer without a cast
make: *** [stack-frame.lo] Error 1
make: Leaving directory `/home/antoine/downloads/memprof-0.6'
make: *** [all-recursive] Error 1
make: Leaving directory `/home/antoine/downloads/memprof-0.6'
make: *** [all] Error 2
Any advice on how to get memprof working on Ubuntu Jaunty?
Where can I find useful documentation?
Is memprof the only way to get information regarding memory usage of programs?
Regarding my setup, I use Ubuntu Jaunty Jackalope with packages from xorg-edger PPA which means I use
ati driver with git (2009 06 11)
Detailed information can be found at https://launchpad.net/~xorg-edgers/+archive/ppa
My card is
(--) PCI:*(0@1:5:0) ATI Technologies Inc Radeon Xpress 1250 rev 0, Mem @ 0xd8000000/134217728, 0xd0100000/65536, I/O @ 0x00009000/256
(In reply to comment #12)
> Is memprof the only way to get information regarding memory usage of programs?
I use http://cgit.freedesktop.org/~ickle/odin -- but be warned that's been written to meet my needs and little else. ;-)
A simpler tool is http://cgit.freedesktop.org/cairo/tree/util/malloc-stats.c which just needs to be compile to a shared library and preloaded.
(In reply to comment #13)
> I use http://cgit.freedesktop.org/~ickle/odin -- but be warned that's been
> written to meet my needs and little else. ;-)
Looks very nice, nice choice of name as well. :)
In particular, like memprof this shows where the memory was allocated at any time, not only at process termination.
> A simpler tool is http://cgit.freedesktop.org/cairo/tree/util/malloc-stats.c
> which just needs to be compile to a shared library and preloaded.
Not sure what this offers over valgrind on a quick glance.
Pardon my ignorance but how do I compile odin?
I tried executing configure.in but got this:
./configure.in: line 1: syntax error near unexpected token `2.54'
./configure.in: line 1: `AC_PREREQ(2.54)'
I have autoconf 2.63
More people confirmed this huge leak:
I changed the title and product, since it happens with nvidia and intel cards too.
Antoine, are you on amd64 too?
If os, this could be arch specific...
(In reply to comment #18)
> Antoine, are you on amd64 too?
> If os, this could be arch specific...
Yes, my architecture is 64 bits.
According to the KDE bug report this was a bug in Amarok.
on Dec 09, 2016 at 13:27:20.
(provided by the Example extension).