LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   top command question (https://www.linuxquestions.org/questions/linux-newbie-8/top-command-question-601451/)

mokku 11-21-2007 09:37 AM

top command question
 
Hi,

I am using the top command and getting the following value in the bottom. I am trying to see the memory usage for this proces.

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23175 javackk 23 0 1281m 302m 25m S 9.9 2.6 397:35.40 /usr/java/jdk1.5.0_

What is VIRT and RES represening? It means 1281M memory is allocated for this process and using only 302 M? Please correct me.

pixellany 11-21-2007 09:55 AM

"man top" gives a description of all the fields. I don't totally understand linux memory management, so I won't presume to explain it.

mokku 11-21-2007 09:59 AM

I read it, but I am not unserstanding it. That's why I want the explanation,.

forrestt 11-21-2007 11:04 AM

Here is what man says (I'm not sure what you don't understand):

Code:

VIRT -- Virtual Image (kb)
The total amount of virtual memory used by the task.  It includes all code, data and shared libraries plus pages that have been swapped out.  (Note: you can define the STATSIZE=1 environment variable and the VIRT will be calculated from the /proc/#/state VmSize field.)

VIRT = SWAP + RES.

RES -- Resident size
The non-swapped physical memory a task has used.

RES = CODE + DATA.

Resident size is the size of the binary code that is run that is controlling the program PLUS the amount of data that the program is using which is NOT swapped to disk. It is basically the amount of physical memory used.

The virtual image is the total of all the memory used by the task, both physical AND swap.

HTH

Forrest


All times are GMT -5. The time now is 03:56 AM.