[NTLUG:Discuss] Two questions..
Richard Cobbe
cobbe at directlink.net
Tue Dec 21 21:33:36 CST 1999
George E. Lass wrote on 12-21-1999:
>
> Steve,
>
> Thanks for your explanation of the output of the "free" command.
> I never knew what the " -/+ buffers: " line meant. Your example
> did bring to mind an additional question though. Even without
> considering the amount of memory that the buffers are using, your
> example shows that there is 2160(K) of free memory, but also that
> there is 284(K) of used swap space. Any idea why the swap space
> is being used when there is available free memory?
>
Actually, I lied. The explanation isn't really all that complex. So, here
'tis:
This 284K represents pages, from various applications or libraries, which
got dumped to disk for a number of reasons: apps & libraries using more
than the physical RAM, expanding the disk cache at the expense of user/lib
memory, and so forth. Most OS's, and I suspect Linux is one of them, use
demand-based paging: if a page got swapped out for one of the above
reasons, it won't get brought back in unless it's referenced. These pages
likely belong to one of the dormant processes on your system: various net
servers sleeping until net connections come in, the mingettys or whatever
on unused virtual consoles, and so forth. Since these processes are
sleeping, their memory won't get swapped in.
There are other reasons why pages could get dumped to disk, and in these
cases, they would be brought back in after a certain amount of time, even
if they weren't referenced. This is a more complex and somewhat un-related
issue.
If that's not clear, or people have any questions, let me know.
Richard
More information about the Discuss
mailing list