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.
!!!!!!! Don't be fooled by the name, it doesn't just represent the swapped
out data. !!!!!!!!!!!
http://www.linuxforums.org/misc/using_top_more_efficiently_3.html
On 1/16/07, Oded Arbel <[EMAIL PROTECTED]> wrote:
On Tue, 2007-01-16 at 12:09 +0200, Constantine Shulyupin wrote:
VIRT stands for the virtual size of a process, which is the sum ofmemory it is
actually using, memory it has mapped into itself (forinstance the video card's
RAM for the X server), files on disk thathave been mapped into it (most notably
shared libraries), and memoryshared with other processes. VIRT represents how
much memory theprogram is able to access at the present moment.
I'm assuming that shared library mmaped are counted in the "shared"
section, which is neglegable - for all GNOME apps and applets, even evo with
a 1.5GB footprint is never more then 20MB. What other stuff is mmaped ?
I don't think that disregarding the VIRT value when checking memory
consumption is wrong, as an application with a large memory footprint is
more likely to swap, swapping is expensive and if a lot of applications
(virtually any single tine little GNOME applet I'm using) are swapping, it
can easily bring down a powerful computer.
--
Oded
::..
"Clinton lied. A man might forget where he parks or where he lives, but he
never forgets oral sex, no matter how bad it is."
-- Barbara Bush (Former US First Lady)
--
Constantine Shulyupin
Embedded Linux Consultant
054-4234440
http://linuxdriver.co.il/