"ps" が報告するメモリーの使用量が、"free" が報告する使用量と大きく異なる理由
Issue
-
ps
が報告する RSS 値の総量が、free
が報告するメインのメモリー使用量よりもはるかに低くなります。たとえば、次のようになります。$ ps aux | grep -v "USER" | awk 'BEGIN{sum=0}{sum+=$6}END{print sum}'
387056
$free
total used free shared buffers cached
Mem: 2070740 1956740 114000 0 471584 863064
-/+ buffers/cache: 622092 1448648
Swap: 4192924 384 4192540
この環境では、ps の RSS の総量は 387056kB で、free が示す -/+ buffers/cache の使用量は 622092kB です。使用量が 235036 kB も異なるのはなぜですか?
ps aux
が報告するメモリー使用量の総計が、物理メモリーの総計よりも大きくなります。
Environment
- Red Hat Enterprise Linux (RHEL) の全てのバージョン
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.