如何监视专用于内核的内存使用情况?


10

如果我错了,请纠正我,但top命令仅监视应用程序的内存使用情况,而不监视内核专用的内存使用情况。

您将如何监视专用于内核的内存使用情况?

Answers:


7

内核通过/ proc / slabinfo导出此信息。它不是很容易阅读,因此还有一个slabtop工具(来自procps,您可能已经安装了它)。

我通常使用这种调用,但是请查看手册页以了解它还能做什么:

slabtop -s c

1

AFAIK,SLAB是内核的几种内存分配器之一

内核使用更多的内存

看到 "smem -twk"

例如ubuntu桌面

# smem -twk
Area                           Used      Cache   Noncache
firmware/hardware                 0          0          0
kernel image                      0          0          0
kernel dynamic memory          1.1G     802.0M     299.7M
userspace memory               2.2G     218.1M       2.0G
free memory                  440.1M     440.1M          0
----------------------------------------------------------
                               3.7G       1.4G       2.3G

# slabtop -s c

 Active / Total Objects (% used)    : 486431 / 618408 (78,7%)
 Active / Total Slabs (% used)      : 17621 / 17621 (100,0%)
 Active / Total Caches (% used)     : 77 / 108 (71,3%)
 Active / Total Size (% used)       : 157060,61K / 182206,62K (86,2%)
 Minimum / Average / Maximum Object : 0,01K / 0,29K / 8,00K
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.