After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 172472 - gnome-menus leaks on .desktop moves
gnome-menus leaks on .desktop moves
Status: RESOLVED FIXED
Product: gnome-menus
Classification: Core
Component: general
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-menus dummy account
gnome-menus dummy account
Depends on:
Blocks:
 
 
Reported: 2005-04-02 22:19 UTC by Sebastien Bacher
Modified: 2005-04-05 22:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnome-menus log (9.18 KB, text/plain)
2005-04-05 10:55 UTC, Sebastien Bacher
  Details
valgrind --tool=memcheck --leak-check=yes --num-callers=15 --show-reachable=yes gnome-menu-spec-test --monitor 2>gnome-menus-log.txt (33.71 KB, text/plain)
2005-04-05 13:47 UTC, Sebastien Bacher
  Details
gnome-menus-2-10-fix-parent-references.diff (6.09 KB, patch)
2005-04-05 21:02 UTC, Mark McLoughlin
none Details | Review

Description Sebastien Bacher 2005-04-02 22:19:30 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"
Comment 1 Sebastien Bacher 2005-04-02 22:23:33 UTC
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
Comment 2 Mark McLoughlin 2005-04-04 15:01:31 UTC
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
Comment 3 Sebastien Bacher 2005-04-05 10:55:10 UTC
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
Comment 4 Mark McLoughlin 2005-04-05 12:08:05 UTC
Right, that's what I was seeing too - no menu specific leaks. I wasn't seeing
gnome-panel crash under valgrind, though.
Comment 5 Sebastien Bacher 2005-04-05 13:38:29 UTC
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 ?
Comment 6 Sebastien Bacher 2005-04-05 13:47:02 UTC
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
Comment 7 Mark McLoughlin 2005-04-05 21:02:42 UTC
Created attachment 39725 [details] [review]
gnome-menus-2-10-fix-parent-references.diff
Comment 8 Mark McLoughlin 2005-04-05 21:04:10 UTC
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.
Comment 9 Sebastien Bacher 2005-04-05 22:16:59 UTC
the patch works just fine on a GNOME 2.10 uptodate, thanks!