The thing is that what is happening is a little different from what you are thinking

you run out of physical ram and P1 has cause you to use an additional 20GB of swap space. That swap space is very unlikely to contain any address space allocated to process P1, it's almost always going to be address space allocated to other programs (after all P1 has used it's memory more recently than those other processes)

you then start process P2 which uses another 3G of memory.

you now have 23GB is swap, little or any of which is in the P1 or P2 address space.

proceee P1 exits.

The system now has 23GB in swap and 20GB of free memory to use for something else.

The system is not going to take the time to pull the data back in from swap unless some application needs it.

David Lang

On Mon, 27 Aug 2012, Andrew Hume wrote:

err, that is the whole point.
SwapTotal - SwapFree reflects the high water mark problem.
for example, if we are swapping, and process P1 has 20GB of swap,
then SwapTotal - SwapFree = 20GB. if i start a new process P2 which uses
3GB swap, then SwapTotal - SwapFree = 23GB. Great!
process P1 now exits. so only 3GB of swap are actually being used,
and yet SwapTotal - SwapFree = 23GB (still!).

if process P2 now exits, then SwapTotal-SwapFree goes back to 0.

what i would call the real problem is that

        SwapTotal != SwapFree + (swap actually being used)

andrew

On Aug 27, 2012, at 7:32 AM, Dan Ritter wrote:

On Mon, Aug 27, 2012 at 06:49:28AM -0700, Andrew Hume wrote:
i have some colleagues who are being frustrated by the stupid way
Linux measures swap space consumption (the high water mark
of currently running processes).

does anyone know of a way to measure how much swap space is actually being used?

In /proc/meminfo, SwapTotal - SwapFree isn't appropriate for you?

-dsr-


------------------
Andrew Hume  (best -> Telework) +1 623-551-2845
and...@research.att.com  (Work) +1 973-236-2014
AT&T Labs - Research; member of USENIX and LOPSA




_______________________________________________
Tech mailing list
Tech@lists.lopsa.org
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/
_______________________________________________
Tech mailing list
Tech@lists.lopsa.org
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to