Further memory question [was: Clear the computer's memory?]

Kent Borg kentborg at borg.org
Thu Mar 30 13:00:22 UTC 2006

On Thu, Mar 30, 2006 at 01:08:49PM +0100, R Kimber wrote:
> I have a further question about memory use. As I write, having been
> forced to reboot about 10 hours ago, and having 4 not very
> demanding apps open, plus the background stuff that is started at boot,
> Gkrellm tells me that I have 1702MB of memory free out of 2GB.

One subtlety about Linux memory usage is that it figures that if you
have memory, it should use it!  It should use it in anyway that will
help the computer run.  Think of the memory as shelf space at the
local library--you want plenty of it, and you want those shelves in
use, not empty.

Memory will be used to cache disk contents, it will be used for IO
buffers, it will be used to page more of your program's data into RAM.
It will also be used by programs that are, well, using lots of RAM,
including some that start to gobble up lots of swap too.

When judging memory usage, mostly pay attention to computer
performance not numbers.  If you want to watch numbers, maybe watch
the amount of swap in use and get worried if it gets too big (say, it
approaches the size of your RAM or 1GB, which ever comes first--Linux
seems to like always having ~some~ swap in use, don't fret if you see

Firefox is blamed for using a lot of memory, and it does.  It is
trying to follow the same strategy as the operating system: use what
memory it can to improve performance (in this case, keeping rendered
pages ready).  The problem is it is too, shall we say, aggressive in
its cacheing and it soaks up lots of RAM and eats into swap.  A
workaround that seems to work for me is to restart Firefox
occasionally, and maybe don't collect as many open tabs at once.

If you have another program that is using a lot of RAM, quitting that
program should free up all RAM used by that program.  If you want a
drastic step, logoff and back on; for if you are running any
server-like services they probably don't need to be interrupted by a
full reboot.

Does that make Linux's behavior clearer?

-kb, the Kent who points out that Mac OS X will probably behave
similarly, and probably modern MS Windows versions too.

More information about the ubuntu-users mailing list