GNOME Bugzilla – Bug 606143
[csw] aisleriot grows X server without bounds
Last modified: 2010-01-11 15:29:12 UTC
In aisleriot, make sure the "Click to move" option is disabled in the Control menu, then move card stacks around using the mouse, while watching X server memory use in top. Results: X server VIRT grows continually, while RES and SHR stay about the same. Eventually, card stacks start leaving trails that will eventually take many seconds to disappear, while the system swaps madly. This appears to be a problem that is caused by csw: - it is *not* reproducible when running with GDK_NATIVE_WINDOWS=1 - all reports of this problem are on gtk 2.18 / ubuntu 9.10 (e.g. https://bugs.launchpad.net/ubuntu/+source/gnome-games/+bug/503428 https://bugs.launchpad.net/ubuntu/+source/gnome-games/+bug/498669 https://bugs.launchpad.net/ubuntu/+source/gnome-games/+bug/483698 https://bugs.launchpad.net/ubuntu/+source/gnome-games/+bug/480523 https://bugs.launchpad.net/ubuntu/+source/gnome-games/+bug/472061 https://bugs.launchpad.net/ubuntu/+source/gnome-games/+bug/469172 ) This is also not reproducible if you enable the "Click to move" function. I can reproduce this on a first-series EEEPC running Fedora 12 (i915 graphics driver). It also appears to be dependent on the X server used, since I *cannot* reproduce this on my main machine which is running intrepid (still using gtk master for aisleriot, of course) with the nvidia driver.
I should also mention that closing aisleriot will release all that X server memory again. And valgrind shows no leaks in aisleriot or gtk+, and certainly not in the order of hundreds of MiB.
Running xrestop makes it clear that there's a heavy pixmap leak somewhere.
Looks like the leaks are somehow caused by the gdk_gc_set_clip_origin calls in the board-noclutter.c expose handler. Commenting those out makes it hard to drag the cards (because they become invisible), but makes the pixmap count largely stay constant.
Created attachment 150954 [details] [review] a patch Here is a patch that seems to fix the leak, both server-side, and the client-side leak of GdkPixmaps as well. Alex, does this look right to you ?
Looks correct.