[PLUG] Linux memory usage
Paul Heinlein
heinlein at attbi.com
Mon Jun 30 11:42:03 UTC 2003
On Mon, 30 Jun 2003, Scott Van Hoosen wrote:
> I'm curious as to how to interpret free memory in Linux. It seems as
> though memory gradually gets used up more and more each day, until
> free memory gets very small. I know this is not what is actually
> happening, because even when only a small amount of memory is free,
> I can open several programs, like OpenOffice, Mozilla, Evolution,
> etc, and the swap file will not be used.
>
> Does Linux somehow keep old programs and/or data in memory after
> they are closed, only removing it from memory when it is needed?
>
> How can I know how much memory is actually available?
Linux is pretty aggressive about using RAM to buffer data from disk.
Try using the 'free' command; it "displays the total amount of free
and used physical memory and swap space in the system, as well as the
buffers and cache consumed by the kernel" (the free(1) man page).
For example, my workstation at work has a half-gig of memory.
According to free, nearly 300 (293) megabytes of RAM is just cached
files. The stuff in cache can be flushed if the kernel should
suddenly need to allocate a big hunk of memory to a new process.
[heinlein at glenfiddich heinlein]$ free -m
total used free shared buffers cached
Mem: 501 492 9 0 86 293
-/+ buffers/cache: 112 388
Swap: 996 26 969
--Paul Heinlein <heinlein at attbi.com>
More information about the PLUG
mailing list