| I don't know if you know what these caches and buffers are. Basically, linux caches everything it ever reads from the hard drive in memory, so that it doesn't have to be re-read later. If a process needs more memory and there's no free memory, a cache page is destroyed and returned to the program instead. Since there is no other reason for freeing these cache pages, linux simply doesn't. So those 57% of used memory are mostly just things that have once been read from your hard drive, they aren't what keeps the system alive. For the same reason, not much memory is freed when a terminate a process, since most of that memory are just mapped directly from the hard drive to that process' memory space. Therefore that memory isn't freed either. There are also shared libraries, ie. subroutine libraries such as libc or Xlib that are in use by several processes simultaneously, so if one of them exits, the memory occupied by these libraries cannot be freed since it's still used by the remaining processes. It's an incredibly effective way to save memory, since libc only has to be loaded once and then used by all processes in the system.
I, too, have 512 MB of RAM, and it's constantly full. Right now, I've got 11 MB free. But on the other hand, Linux has probably cached my entire directory tree, which speeds up disk searches tremendously. And it doesn't hurt, since these caches can easily be given to any process that would need them.
To find out how much memory is really free, take the indicated free memory and add the caches and buffers fields to it. |