GNOME Bugzilla – Bug 172472
gnome-menus leaks on .desktop moves
Last modified: 2005-04-05 22:17:00 UTC
This bug has been opened here: https://bugzilla.ubuntu.com/8278 "Test case: 1. Open System Monitor and observe the amount of memory that the gnome-panel process is using. In my case it was approximately 27MB. Leave System Monitor open. 2. Install a large package or metapackage. I installed the "kde" metapackage. 3. Observe the amount of memory that gnome-panel is using. 4. Remove the package you just installed. I did this with "apt-get remove libqt* kde*" 5. Observe the amount of memory that gnome-panel is using. 6. Purge the package with something like "COLUMNS=200 dpkg -l | grep ^rc | 'awk {print $2}' | xargs dpkg --purge" 7. Observe the amount of memory that gnome-panel is using. At (3) and (5), I am seeing memory use increases of about 30MB. At (7), I saw an increase of about 40MB. ... OK, so I did a more controlled test with a new user and the default desktop (I su-ed to a sudoable user in the terminal to perform the installation): Total RSS Shared Step 1: Test platform: 26.7MB 11.2MB 8.1MB Step 2: KDE Installed: 81.5MB 65.9MB 8.1MB Step 3: KDE Removed : 133.4MB 117.9MB 8.1MB"
That seems to happen when a .desktop is moved: 34004 16m 9156 S 0.0 1.6 0:02.00 gnome-panel * mv /usr/share/applications/totem.desktop ~ 34132 16m 9156 S 0.0 1.7 0:02.38 gnome-panel * mv ~/totem.desktop /usr/share/applications/ 34260 16m 9156 S 1.0 1.7 0:02.70 gnome-panel
Not seeing this here. Try getting valgrind logs from gnome-menu-spec-test --monitor and gnome-panel. Here's what I was doing: 1) valgrind --tool=memcheck --show-leaks=yes --num-callers=15 \ gnome-menu-spec-test --monitor 2>gnome-menus-log.txt 2) gnome-session-remove gnome-panel 1) GNOME_PANEL_DEBUG=1 valgrind --tool=memcheck --show-leaks=yes \ --num-callers=15 gnome-panel 2>gnome-panel-log.txt and then doing your test case followed by C-c
Created attachment 39705 [details] gnome-menus log log from "valgrind --tool=memcheck --leak-check=yes --num-callers=15 gnome-menu-spec-test --monitor 2>gnome-menus-log.txt" I don't have the gnome-panel log for the moment, gnome-panel crashes when started with valgrind
Right, that's what I was seeing too - no menu specific leaks. I wasn't seeing gnome-panel crash under valgrind, though.
gnome-panel refuse to run with valgrind for the moment but gnome-menu-spec-test leaks too, so I guess we can work on it: $ ps u | grep menu seb128 30999 3.3 0.3 6556 3180 pts/7 S+ 15:35 0:00 gnome-menu-spec-test --monitor $ mv /usr/share/applications/totem.desktop . $ ps u | grep menu seb128 30999 1.2 0.3 6684 3284 pts/7 S+ 15:35 0:00 gnome-menu-spec-test --monitor $ mv totem.desktop /usr/share/applications/ $ $ ps u | grep menu seb128 30999 1.5 0.3 6812 3376 pts/7 S+ 15:35 0:00 gnome-menu-spec-test --monitor any idea on how I could track this ?
Created attachment 39710 [details] valgrind --tool=memcheck --leak-check=yes --num-callers=15 --show-reachable=yes gnome-menu-spec-test --monitor 2>gnome-menus-log.txt
Created attachment 39725 [details] [review] gnome-menus-2-10-fix-parent-references.diff
Cool, it only shows up with --show-reachable because its a cylic reference which was causing the leak. I've attached the patch I'm committing on gnome-2-10. I'd appreciate if you could test that - I've only given it very basic testing and its a fair bit different from the patch on HEAD.
the patch works just fine on a GNOME 2.10 uptodate, thanks!