Linux 如何解释来自 htop 的内存使用信息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17435351/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I interpret the memory usage information from htop
提问by olala
We have multiple servers in our lab and I tried to determine which one has more resources currently available. I tried to interpret the information htop displays but I'm not 100% understanding all those numbers.
我们的实验室中有多台服务器,我试图确定哪台服务器当前有更多可用资源。我试图解释 htop 显示的信息,但我不是 100% 理解所有这些数字。
I have taken a screen shot for each server after issuing htop:
发出 htop 后,我为每个服务器拍摄了屏幕截图:
Server #1:
服务器 #1:
Server #2:
服务器#2:
Does server #1 have more memory available than server #2? Should I look at Avg or Mem? Or what other parameter should I look at?
服务器#1 的可用内存是否比服务器#2 多?我应该看 Avg 还是 Mem?或者我应该查看哪些其他参数?
Thanks!
谢谢!
采纳答案by Hisham H M
htop author here.
htop 作者在这里。
Does server #1 have more memory available than server #2?
服务器#1 的可用内存是否比服务器#2 多?
Yes.
是的。
From the htop faq:
The memory meter in htop says a low number, such as 9%, when top shows something like 90%! (Or: the MEM% number is low, but the bar looks almost full. What's going on?)
The number showed by the memory meter is the total memory used by processes. The additional available memory is used by the Linux kernel for buffering and disk cache, so in total almost the entire memory is in use by the kernel. I believe the number displayed by htop is a more meaningful metric of resources used: the number corresponds to the green bars; the blue and brown bars correspond to buffers and cache, respectively (as explained in the Help screen accessible through the F1 key). Numeric data about these is also available when configuring the memory meter to display as text (in the Setup screen, F2).
htop 中的内存表显示的是一个较低的数字,例如 9%,而 top 显示的是 90% 之类的东西!(或者:MEM% 数字很低,但条形看起来几乎满了。这是怎么回事?)
内存表显示的数字是进程使用的总内存。额外的可用内存被 Linux 内核用于缓冲和磁盘缓存,因此总的来说几乎整个内存都被内核使用。我相信 htop 显示的数字是一个更有意义的资源使用指标:数字对应于绿色条;蓝色和棕色条分别对应于缓冲区和缓存(如通过 F1 键访问的帮助屏幕中所述)。当将内存表配置为显示为文本时(在设置屏幕中,F2),有关这些的数字数据也可用。
Hope that clears things up! Cheers!
希望这能说明问题!干杯!