As an illustration of my recent release of smem 0.9, here's how Gnome desktop rivals Gnote and Tomboy compare on memory usage.
Methodology: take a normal GNOME desktop and add either Gnote or Tomboy to a panel. Restart X, open a single terminal window, take a process size measurement, open up the "Search All Notes" window, take another process size measurement, then measure libary sizes.
Here's what the output for a freshly-started Gnote looks like:
# smem -P gnot*e -t PID User Command Swap USS PSS RSS 8552 mpm /usr/bin/gnote --panel-appl 0 13652 14915 23896 ------------------------------------------------------------------------------- 87 1 0 13652 14915 23896
'RSS' (resident set size) is the measure reported by most tools, and shows 23.8MiB of memory usage by Gnote. But that number is misleading as it counts all the memory used by numerous shared libraries (Gnote uses about 170 shared mappings). In fact, most developers (rightly) ignore this number as meaningless and (not so rightly) assume that the bulk of memory usage is shared.
If we compare running Gnote and not running Gnote, we'll see a much smaller difference in memory usage. In fact, the difference we'll see is in the table above as 'USS' (unique set size). There's 13.6MiB of memory that's used only by Gnote. The remaining 10.2MiB is shared with other applications. 'PSS' (proportional set size) accounts for that difference by dividing up shared ownership of libraries on a page by page basis. If you add up the PSS of all the processes on the system, they will sum to the total (userspace) memory usage.
So, Gnote's real share of memory is 14.9MiB, once sharing is accounted for. Fairly expensive for having only drawn a 32x32 icon so far. Hell, that's fairly expensive for a full-featured GUI environment and wordprocessor by mid-'90s standards, but I digress.
Now let's look at a freshly-started Tomboy:
# smem -P tom*boy -t PID User Command Swap USS PSS RSS 7873 mpm bash /usr/bin/tomboy-panel 0 464 652 1612 7885 mpm mono /usr/lib/tomboy/Tomboy 0 21732 22618 31116 ------------------------------------------------------------------------------- 89 1 0 22196 23270 32728
First note that Tomboy here is getting launched by an extra persistent copy of bash that chews up an extra 652KiB of memory. But the numbers for the main process are all larger also (by about 8MiB, 7.7MiB, and 7.2MiB respectively). 6.9MiB of that is 21 Mono libraries that are only used by Tomboy (at least on my desktop):
$ smem -m -M mono -t Map PIDs AVGPSS PSS /dev/shm/mono.9295 1 4 4 /usr/lib/mono/gac/NDesk.DBus.GLib/1.0.0. 1 8 8 /usr/lib/mono/gac/gconf-sharp/2.24.0.0__ 1 12 12 /usr/lib/mono/gac/gnome-panel-sharp/2.24 1 16 16 /usr/lib/mono/gtk-sharp-2.0/libglibsharp 1 16 16 /usr/lib/mono/gtk-sharp-2.0/libgdksharpg 1 24 24 /usr/lib/mono/gac/gmime-sharp/2.2.0.0__2 1 48 48 /usr/lib/mono/gac/atk-sharp/2.12.0.0__35 1 56 56 /usr/lib/mono/gac/pango-sharp/2.12.0.0__ 1 60 60 /usr/lib/mono/gac/NDesk.DBus/1.0.0.0__f6 1 72 72 /usr/lib/mono/gac/glib-sharp/2.12.0.0__3 1 84 84 /usr/lib/mono/gtk-sharp-2.0/libgtksharpg 1 92 92 /usr/lib/mono/gac/gnome-sharp/2.24.0.0__ 1 140 140 /usr/lib/mono/gac/Mono.Posix/2.0.0.0__07 1 172 172 /usr/lib/mono/gac/Mono.Addins/0.4.0.0__0 1 180 180 /usr/lib/mono/gac/gdk-sharp/2.12.0.0__35 1 180 180 /usr/lib/mono/gac/System/2.0.0.0__b77a5c 1 644 644 /usr/lib/mono/gac/System.Xml/2.0.0.0__b7 1 652 652 /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35 1 1116 1116 /usr/bin/mono 1 1648 1648 /usr/lib/mono/2.0/mscorlib.dll 1 1660 1660 ----------------------------------------------------------------- 21 21 6884 6884Here's the PSS numbers including firing up search:
| Tool | Startup | Search |
| Gnote | 14915 | 16929 |
| Tomboy | 23270 | 27197 |