Memory testing with exmap
Download data collected during testing -- Includes a Gnumeric spreadsheet, a better formatted version of this document, and all the screenshots.
Initial setup
- Ubuntu 7.10 (Linux) with a test user account. Running on a AMD Duron with 256MB of RAM. Test account's gnome session is setup previously with no startup apps, 1 top panel, and no applets. The panel run dialog is used to start an xterm from which commands can be launched. Root user is logged in through ssh to capture exmap data. exmap module is loaded into kernel.
exmap-console-0.4.1 from OpenedHand is used.
Tools
- Screenshots taken with:
- xwd -root -out filename.xwdump
- exmap --no-elf-info --format=csv+sums \
- $(ps h -u test | awk '{print $1;}') \
> filename.csv
- $(ps h -u test | awk '{print $1;}') \
Procedure
- 00-panel-xterm
- Logged in with just a panel and xterm.
- 01-applets
- Added some applets to the panel:
- Menu
- Task switcher
- Tray
- Workspace switcher
- GNOME System monitor
- Clock
- Volume control
- Trash
- 02-evolution
- Start evolution (without calendar component) Viewing an IMAP account with a couple of e-mails, looking at a HTML e-mail.
- 03-clearlooks
- Change theme to Clearlooks:
- gconftool --type=string \
- --set /desktop/gnome/interface/gtk_theme Clearlooks
- gconftool --type=string \
- Change theme to Clearlooks:
- 04-default-theme-exit-ev
- Change back to default theme:
- gconftool --type=string \
- --set /desktop/gnome/interface/gtk_theme asdf
- gconftool --type=string \
- Change back to default theme:
- 05-ev-calendar
- Enable calendar components and restart evolution. Have a look at the calendar week view.
- 06-pidgin-gg
- Start pidgin and log into a Gadu Gadu account.
- 07-pidgin-no-plugin
- Remove all plugins and restart pidgin.
- 08-pidgin-gg-only
- Add back the Gadu Gadu plugin and restart pidgin.
- 09-back-to-desktop
- Exit pidgin.
- 10-tracker
- Add the tracker applet to the panel. Perform a search then close the results window.
- 11-ubuntu-session
- Start all programs that are in the GNOME startup list by default in Ubuntu. - nm-applet - gnome-power-manager - gnome-volume-manager - bluetooth-applet - update-manager
- 12-nautilus
- Start nautilus to get some wallpaper.
Data preparation
- Use zsh
- for f in [0-9]*.csv
- do
- fgrep -v "Exmap log ends" $f | sed -e "s/Exmap log/Exmap log $f/"
done > all.csv
- do
- Import into gnumeric
- Hide all columns except pid,command,VM,emapped
- Autofilter pid column to non-blank.
- By hand, fix the totals formulas, because the cells are not correct after catting the spreadsheats together
- Resize columns to fit numbers
- Format the number columns to add separators for 1000s
- Save as all.gnumeric
- for xwd in *.xwdump
- do
- convert $xwd $xwd:r.png
- do
Interpretation of data
- The "effective mapped" figure given by exmap is used. Exmap divides the memory usage of shared libraries between the applications which use the libraries. Therefore memory is not counted twice, and memory usage is fairly accounted to the correct process. This is what is meant by "effective". Mapped memory includes pages from mmap'd files (e.g. the theme's icon caches are mmapped). Linux loads its 4k pages on demand, so only the areas of the file which are in use are resident.
Faults with this procedure
- This procedure uses a minimal desktop with very few programs running. Therefore there is little sharing of libraries. Thus, the numbers for individual programs are higher than they would be if measured as part of a full bells-and-whistles GNOME desktop.
Results
Total effective mapped memory after each step
|
emapped |
00-panel-xterm |
35,280,796 |
01-applets |
50,038,213 |
02-evolution |
72,619,459 |
03-clearlooks |
73,148,818 |
04-default-theme-exit-ev |
55,728,128 |
05-ev-calendar |
77,282,624 |
06-pidgin-gg |
68,062,490 |
07-pidgin-no-plugin |
64,604,638 |
08-pidgin-gg-only |
65,175,351 |
09-back-to-desktop |
55,614,619 |
10-tracker |
94,289,562 |
11-ubuntu-session |
71,171,143 |
12-nautilus |
71,785,155 |
Effective mapped memory cost of...
- Please see the formulas in the spreadsheet to see how these were calculated.
applets
14,757,417
evolution w.o. calendar
22,581,246
evolution calendar
4,663,165
clearlooks
529,359
notification-daemon[1]
5,576,406
pidgin
12,447,871
all pidgin protocols
3,457,852
gadu gadu plugin
570,713
tracker applet
38,674,943
ubuntu session startup[2]
15,556,524
nautilus
16,170,536
- [1] includes size increase of other processes [2] this number is much larger than it would normally be because there is little sharing of libraries in this setup.
Discussion
- These measurements confirm some of the points brought up by Nickolay.
Applets
- Applets use a lot of memory. Everyone knows this but maybe less people know why.
Clearlooks
- Great looking theme, 500k isn't much to pay for it. However what is the relationship between the number of widgets on screen and a theme's memory usage?
notification-daemon
- What is this process anyway? The number given is the different between step 09 and step 01 and is about 1MB too big. It includes the increase in memory size of other processes (e.g. xterm) between the two steps.
Gadu Gadu plugin
- It's good. The only reason I use Pidgin.
Further research
Investigate causes of...
Applet memory usage
- (smart people have already tried this and have succeeded in reducing applet memory usage)
libpurple memory usage for unused protocol plugins
- Could be a bug in libpurple.
Measure memory usage of screenlets
- My guess is that they use more memory than panel applets.
Measure memory usage of other applications
- e.g. F-Spot without any photos, F-Spot with 100, 200, 500, 1000, 2000, 5000 photos.
Memory usage of GTK+ theme
- How does it scale with the number of widgets on screen?
--- RodneyLorrimar 13/3/2008