Tuesday, May 09, 2006

Track down your first leak!

Now that gnome-system-monitor gives useful information, I've been keeping it open quite a while. There is pretty clearly a slow memory leak. The heap grows by just keeping it open (i've been having it in the process view). You need it open over a period of a few hours to notice the leak. I first saw it after leaving it on over night.

Want an easy way to get your hands dirty with performance? This is your chance. I've filed the bug as #341175. Here is the plan of action:

  1. Reproduce the bug, make sure you can see it. I'm using GNOME 2.14, as it is packaged on Dapper.
  2. Run G-S-M under valgrind. I like to use the following flags valgrind --num-callers=20 --leak-check=yes --show-reachable=yes --leak-resolution=high gnome-system-monitor. This will generate a large dump file, because it showes stuff that's still reachable. However, this will help you if gsm retains pointers to memory, but just doesn't use it.
  3. Figure out who's to blame
  4. Patch it

If you complete any of these steps, please update your progress in the bug report. Again, this is a great chance for somebody new to performance work to get involved. If you need help, go to #performance on IRC, and one of the performance hackers will help you.

Talking of performance masters, Ubuntu users should thank Sebastien Bacher. The fair seb128 checked in a patch that puts many of the gnome-panel applets in process. This saves a good amount of ram. Thanks Sebastien!

1 comment:

Anonymous said...

I see the same behavior. I normally leave g-s-m on all day&night, on the processes tab. It starts at 4 MB writable, but eventually nears 20, after a day or so, at which time I generally restart it.