On Tue, 2007-01-16 at 12:40 +0200, Constantine Shulyupin wrote:
> SWAP (key 'p') 
> 
> The size of swapped out portion of a task's virtual memory image. This
> field is sometimes confusing, here is why:
> 
> Logically, you would expect this field really shows whether your
> program is partially swapped out and how much. But the reality shows
> otherwise. Even the "Swap used" field shows 0, you will be surprised
> that SWAP field of each tasks show greater than zero number. So,
> what's wrong?
> 
> This comes from the fact that top use this formula:
> 
>                 VIRT = SWAP + RES or equal
>                 SWAP = VIRT - RES
> 
> As explained previously, VIRT includes anything inside task's address
> space, no matter it is in RAM, swapped out or still not loaded from
> disk. While RES represents total RAM consumed by this task. So, SWAP
> here means it represents the total amount of data being swapped out OR
> still not loaded from disk. 


I see. I don't think SWAP is exactly VIRT - RES: for example, the
sensors applet has VIRT 94MB, RES 15MB and SHR 8M, but SWAP is listed as
75MB.

For most apps, it looks as if SWAP is indeed = VIRT - RES which, if RES
includes SHR, seems to me to indicate that all the memory mapped to the
task is either resident or swapped: which is consistent with my feel of
the system where when the accumulated VIRT of all the processes about
equals available swap space + dynamic memory then the system breaks.

--
Oded
::..
"Hey Mr. postman look and see, what you have in the bag for me. It could
be a bomb or it could be a letter - it doesn't matter, things can only
get better."
    -- 'When the rainbow comes' / Paula Cole




=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to