linux記憶體使用情況檢查詳細信息

linux記憶體使用情況檢查詳細信息

我無法找到記憶體使用情況,但頂部顯示了以下結果。

Tasks:  90 total,   2 running,  88 sleeping,   0 stopped,   0 zombie
Cpu(s): 21.1%us,  1.4%sy,  0.0%ni, 74.0%id,  2.4%wa,  0.0%hi,  1.0%si,  0.0%st
Mem:   8313376k total,  7969976k used,   343400k free,   185496k buffers
Swap:  4096564k total,       92k used,  4096472k free,  7511688k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+ COMMAND                                                                
28213 apache    15   0 48964  33m 3264 R 56.6  0.4   0:07.64 httpd                                                                  
25170 mysql     23   0  156m  39m 4688 S 37.3  0.5  83:34.76 mysqld                                                                 
 1469 root      10  -5     0    0    0 S  0.3  0.0  28:40.90 kjournald                                                              
25981 root      15   0 10192 2936 2352 S  0.3  0.0   0:00.69 sshd                                                                   
    1 root      15   0  2156  644  552 S  0.0  0.0   0:05.31 init

並免費顯示以下內容。

             total       used       free     shared    buffers     cached
Mem:          8118       7764        354          0        181       7335
-/+ buffers/cache:        247       7870
Swap:         4000          0       4000
Total:       12119       7764       4354

誰能告訴我如何找到 top 和 free 顯示的記憶體使用量。

答案1

我不確定你想要什麼,但有一些提示:

cat /proc/meminfo
vmstat 1

答案2

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

VIRT :  Virtual Size of the task. This includes the size of process's executable binary, the data area and all the loaded shared libraries.
RES :   The size of RAM currently consumed by the task. Swapped out portion of the task is not included.
SHR :   Some memory areas could be shared between two or more task, this field reflects that shared areas. The example of shared area are shared library and SysV shared memory.

(根據錯誤答案進行編輯 - 感謝@mattdm)

答案3

Linux 核心將記憶體用作磁碟緩衝區。這是正常現象,無需擔心。如果正在運行的進程需要內存,將從緩衝區中獲取內存。看一下linuxatemyram.com了解更多。

相關內容