Anders Johansson wrote:
On Monday 13 June 2011 14:43:08 David Haller wrote:
Hello,
On Mon, 13 Jun 2011, Per Jessen wrote:
jsa wrote:
On 06/12/2011 07:46 AM, Anton Aylward wrote:
The 'swapon' command will tell me how much swap is being used.
Is there anything that will tell me what is using swap, what programs, processes etc are using it or what the contents of swap is?
Forgot to add, you can run top in a terminal and then press f followed by p to add a column for swap usage.
Or just swap = virtual - resident.
So:
ps -eo vsz,rss,cmd | awk '{ printf("%10s %s\n", $1 - $2, $3); }'
Nah, that won't work. The virtual size of a process includes everything, even things that haven't been loaded yet, parts of mmap:ed files that have never touched memory, allocated memory that hasn't been used, shared memory that has been mapped into the process address space, shared libraries etc. That calculation will very likely tell you that you are using a million times more swap than you actually have
If you take a quick(!) look at top with the swap column added, my calculation of swap = virtual - resident is pretty close on a regular system. I'm sure there are plenty of exceptions, but if one is concerned about memory usage and swap usage, top does provide a good starting point. -- Per Jessen, Zürich (20.6°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org