开发者

Why the SWAP listed in the detail list of the TOP command is greater than in the summary?

开发者 https://www.devze.com 2023-02-15 01:01 出处:网络
The TOP command results: Mem:3991840k total,1496328k used,2495512k free,156752k buffers **Swap**:3905528k total,**3980k** used,3901548k free,447860k cached

The TOP command results:

Mem:   3991840k total,  1496328k used,  2495512k free,   156752k buffers  
**Swap**:  3905528k total,     **3980k** used,  3901548k free,   447860k cached  

  PID USER      PR  NI  VIRT  RES  SHR S %开发者_Python百科CPU %MEM    TIME+  **SWAP** COMMAND  
28250 www-data  20   0  430m 210m  21m R   63  5.4   0:07.29 **219m** apache2  
28266 www-data  20   0  256m  40m  21m S   30  1.0   0:01.94 **216m** apache2  
28206 www-data  20   0  260m  44m  21m S   27  1.1   0:10.27 **215m** apache2  
28259 www-data  20   0  256m  40m  21m S   26  1.0   0:02.21 **216m** apache2  

The details list shows a group of apache2 processes are using SWAP memory about 210m+ each, but the summary reports only 3980k is used. The total SWAP memory in the detail list is much greater than in the summary. Do the two swap refer the same thing?


Quoted from http://www.linuxforums.org/articles/using-top-more-efficiently_89.html :

VIRT=RES+SWAP

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消