我正在容器中运行用于测试 WAS 的服务器。服务器有 40 个 CPU 核心和 96GB 内存。我在容器中运行 WAS 几天,发现 Slab 内存大小太大。因此停止了所有 WAS。但 Slab 并没有减少。以下是该服务器的内存状态。
root@G14-1:~# cat /proc/meminfo
MemTotal: 98767876 kB
MemFree: 480336 kB
MemAvailable: 24268044 kB
Buffers: 1784 kB
Cached: 8584 kB
SwapCached: 2256 kB
Active: 3852 kB
Inactive: 10264 kB
Active(anon): 1988 kB
Inactive(anon): 7336 kB
Active(file): 1864 kB
Inactive(file): 2928 kB
Unevictable: 5308 kB
Mlocked: 5308 kB
SwapTotal: 100438012 kB
SwapFree: 99383076 kB
Dirty: 0 kB
Writeback: 32 kB
AnonPages: 9088 kB
Mapped: 7468 kB
Shmem: 1208 kB
Slab: 96499028 kB
SReclaimable: 24462728 kB
SUnreclaim: 72036300 kB
KernelStack: 9056 kB
PageTables: 9656 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 149821948 kB
Committed_AS: 1609444 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 33518292 kB
DirectMap2M: 66918400 kB
DirectMap1G: 2097152 kB
板顶
Active / Total Objects (% used) : 314177865 / 316372600 (99.3%)
Active / Total Slabs (% used) : 6945664 / 6945664 (100.0%)
Active / Total Caches (% used) : 97 / 138 (70.3%)
Active / Total Size (% used) : 94206435.41K / 94565538.08K (99.6%)
Minimum / Average / Maximum Object : 0.01K / 0.30K / 18.69K
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
59191120 59188777 0% 0.20K 1479869 40 11838952K vm_area_struct
1237149 1235053 0% 5.81K 252301 5 8073632K task_struct
11548224 11541173 0% 0.59K 218000 54 6976000K inode_cache
3071838 3071813 0% 2.06K 207984 15 6655488K mm_struct
9656484 9654811 0% 0.66K 206299 48 6601568K proc_inode_cache
6502404 6502396 0% 1.00K 205455 32 6574560K signal_cache
3045933 3045926 0% 2.06K 205165 15 6565280K sighand_cache
9319002 9317989 0% 0.69K 204555 46 6545760K sock_inode_cache
9330629 9330629 100% 0.69K 204199 46 6534368K files_cache
6354064 6301629 0% 1.00K 200073 32 6402336K kmalloc-1024
66215808 66213574 0% 0.06K 1034622 64 4138488K anon_vma_chain
5959856 5914764 0% 0.50K 186475 32 2983600K kmalloc-512
31272282 31270906 0% 0.08K 613182 51 2452728K anon_vma
12527025 12506741 0% 0.19K 298977 42 2391816K dentry
12046041 12045609 0% 0.19K 287004 42 2296032K cred_jar
1063926 1052915 0% 2.00K 67884 16 2172288K kmalloc-2048
8383326 8297280 0% 0.19K 199625 42 1597000K kmalloc-192
5566224 5521817 0% 0.25K 174044 32 1392352K kmalloc-256
1052868 1049607 0% 0.94K 31662 34 1013184K xfs_inode
6536288 6536288 100% 0.12K 204259 32 817036K pid
1251180 1244965 0% 0.57K 44685 28 714960K radix_tree_node
5491408 5058053 0% 0.12K 161512 34 646048K kernfs_node_cache
541320 539776 0% 1.05K 19493 30 623776K ext4_inode_cache
31706624 31685396 0% 0.02K 123854 256 495416K kmalloc-16
479202 475497 0% 0.69K 10544 46 337408K shmem_inode_cache
2166016 1678856 0% 0.06K 33844 64 135376K kmalloc-64
345324 143718 0% 0.38K 8222 42 131552K kmem_cache
2381696 2060487 0% 0.03K 18607 128 74428K kmalloc-32
682836 674307 0% 0.09K 16258 42 65032K kmalloc-96
658944 285355 0% 0.06K 10296 64 41184K kmem_cache_node
2874 2698 0% 8.00K 723 4 23136K kmalloc-8192
4491 4307 0% 4.00K 571 8 18272K kmalloc-4096
131136 78644 0% 0.12K 4098 32 16392K kmalloc-128
160384 160384 100% 0.07K 2864 56 11456K Acpi-Operand
10793 10537 0% 0.75K 316 42 10112K au_icntnr
6722 6484 0% 0.94K 203 34 6496K RAW
23320 23188 0% 0.18K 588 44 4704K ip4-frags
9954 9834 0% 0.31K 290 51 4640K bio-4
3640 3360 0% 1.12K 130 28 4160K RAWv6
15551 15477 0% 0.21K 504 37 4032K bsg_cmd
18144 17790 0% 0.16K 504 48 4032K nfsd4_stateids
4719 4719 100% 0.81K 121 39 3872K fuse_inode
6468 6468 100% 0.56K 231 28 3696K task_group
8842 8721 0% 0.38K 225 42 3600K mnt_cache
1472 1440 0% 2.00K 92 16 2944K TCP
46976 46976 100% 0.06K 734 64 2936K ext4_io_end
14742 14742 100% 0.19K 351 42 2808K au_finfo
6664 6664 100% 0.32K 136 49 2176K taskstats
37303 36706 0% 0.05K 511 73 2044K Acpi-Parse
14016 13762 0% 0.12K 438 32 1752K au_dinfo
53 53 100% 18.69K 53 1 1696K kvm_vcpu
16029 15953 0% 0.10K 411 39 1644K buffer_head
5646 5646 100% 0.24K 202 33 1616K xfs_buf_item
3510 3510 100% 0.41K 90 39 1440K btrfs_ordered_extent
1394 1394 100% 0.94K 41 34 1312K mqueue_inode_cache
200 200 100% 5.94K 40 5 1280K net_namespace
560 560 100% 2.18K 40 14 1280K pid_namespace
560 560 100% 2.19K 40 14 1280K TCPv6
免费-m-h
root@G14-1:~# free -m -h
total used free shared buff/cache available
Mem: 94G 70G 456M 32K 23G 23G
Swap: 95G 1.0G 94G
顶部
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
2045 root 10 -10 25784 5164 3936 S 0.0 0.0 0:00.00 /sbin/iscsid
2010867 root 20 0 26488 3672 2120 R 1.6 0.0 0:02.67 htop
2009930 root 20 0 105M 2300 2260 S 0.0 0.0 0:00.54 sshd: root@pts/2
1 root 20 0 240M 2844 2516 S 0.0 0.0 9:16.57 /sbin/init
2008253 root 20 0 105M 2024 2024 S 0.0 0.0 0:02.44 sshd: root
2005975 root 20 0 105M 1996 1996 S 0.0 0.0 0:00.82 sshd: root
2006164 root 20 0 105M 1972 1972 S 0.0 0.0 0:05.95 sshd: root
1783 root 20 0 29952 2108 2108 S 0.0 0.0 0:04.36 /usr/sbin/cron -f
2006718 root 20 0 105M 2180 2180 S 0.0 0.0 0:19.69 sshd: root@pts/4
2009477 root 20 0 105M 2176 2172 S 0.0 0.0 0:11.01 sshd: root@pts/5
2005562 root 20 0 105M 2336 2336 S 0.0 0.0 0:04.28 sshd: root
1420 root 20 0 52172 2360 2300 S 0.0 0.0 0:03.76 /sbin/rpcbind -f -w
2008894 root 20 0 105M 2004 2004 S 0.0 0.0 0:00.74 sshd: root
2005805 root 20 0 105M 2276 2276 S 0.0 0.0 0:00.78 sshd: root
2009025 root 20 0 105M 2116 2116 S 0.0 0.0 0:12.04 sshd: root@pts/1
2009791 root 20 0 105M 2116 2116 S 0.0 0.0 0:00.14 sshd: root@pts/0
32018 root 20 0 195M 2108 2108 S 0.0
由于slabtop,vm_area_struct和task_struct太大。但是现在这个服务器上没有太多进程。最大PID是3303593,但进程数约为481。我猜不出为什么会这样。