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 -20At 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.
CompizCompiz (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 --replaceThat messes up with windows which get all shuffled up but at least, there's no need to exit gdm completely and restart applications.
nm-appletnm-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.