Linux的top命令内存占用问题

top命令,M按内存占用排序后,显示最大占用为mongod进程,只有4.2g,所有进程加起来也只有5,6个g左右,但是used显示为15g.

其他的已用内存是什么?

阅读 2.2k
1 个回答
Keep in mind that there is a distinction between 'active' and 'consumed' memory. Linux tends to store large volumes of data in memory in case it's needed in the future. But processes may not actively be using this memory - in which case they report a lower volume of 'used' memory.
...
You should familiarize yourself with the free command. I also like using htop instead of top, as it displays these differences.

https://serverfault.com/quest...

简单来说就是系统会事先多申请一些内存,所以used中的量是系统申请了的内存,包括已经分配给进程的和没有分配给进程的。你可以试试htop命名,看看是否符合你的预期。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题