I'm one of those Ubuntu users who tries to avoid reboots unless
absolutely necessary. I typically have at least 10 applications running, each one of them with 1 to 3 windows spread out over 4 viewports (terminals,
browser, thunderbird, kate text editors, spreadsheets...). In other words rebooting,
restarting gdm or compiz and setting everything back in place is a
lengthy process.
Regardless, memory leaks are slow killers, the "restart" workarounds cannot be asked from the average user and all leaks eventually make the desktop unstable. It's disappointing to see leaks as big as those make their way into core components of Ubuntu.
But unfortunately, there are two major ones in Natty.
Are you affected too?
You probably are and you will notice if you let your computer run
with unity for more than a day. To verify simply run this command in a
terminal:
ps -eo rss,vsz,pid,cmd,cputime | sort -n | tail -20
At the bottom of the list, you'll find the biggest memory guzzlers on
the system. Repeat the test every few hours and watch the rss and vsz numbers grow for the compiz and nm-applet processes.
Compiz
Compiz (0.9.4) with
Unity (3.8.12). My own
experience on 2 separate laptops shows about
100MB lost per day (rss). There is a bug in Launchpad, the number is
720446:
possible memory leak in compiz when using places, dashboard. The
bug was marked Critical/In progress back in February, it was apparently
fixed then but it came back in April. There's still no fix as of April 5th 2011.
When unity is run long enough without a restart, the system
becomes unresponsive.
To clear up the memory, restart Unity (use Alt-F2):
unity --replace
That messes up with windows which get all shuffled up but at least,
there's no need to exit gdm completely and restart applications.
nm-applet
nm-applet is the network indicator at the top right of the screen. It
belongs to the
network-manager-gnome
package and it's also shamelessly spilling memory, about 50MB per day in
my measurements.
In this case too, there is a bug report:
780602:
nm-applet leaks memory and stops functioning after a while.
User JKL apparently found the root cause of it in glib and proposed a
fix. Given how core glib is, my expectations for a quick fix release are
low.
The workaround is to restart nm-applet once in a while.