How to display kernel slab cache information using Slabtop

To display kernel slab cache information using Slabtop

Slabtop displays detailed kernel slab cache information in real-time. It displays a listing of the top caches sorted using the listed sort criterias. It also displays a statistics header filled with slab layer information.

Run slabtop command without any option to display all the kernel slab information.

root@user1-linuhelp:~# slabtop
Active / Total Objects (% used)    : 513745 / 535134 (96.0%)
 Active / Total Slabs (% used)      : 11959 / 11959 (100.0%)
 Active / Total Caches (% used)     : 73 / 102 (71.6%)
 Active / Total Size (% used)       : 124066.13K / 128612.94K (96.5%)
 Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
129792 121796  93%    0.10K   3328       39     13312K buffer_head
 73374  72356  98%    0.19K   1747       42     13976K dentry
 .
.
.
  2752   2401  87%    0.12K     86       32       344K kmalloc-128
  1792   1792 100%    0.07K     32       56       128K ext4_io_end

Run the following command to refresh kernel slab information with time delay.

root@user1-linuhelp:~# slabtop --delay=3
Active / Total Objects (% used)    : 513589 / 535134 (96.0%)
 Active / Total Slabs (% used)      : 11959 / 11959 (100.0%)
 Active / Total Caches (% used)     : 73 / 102 (71.6%)
 Active / Total Size (% used)       : 124032.57K / 128612.94K (96.4%)
 Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
129792 121796  93%    0.10K   3328       39     13312K buffer_head
 73374  72356  98%    0.19K   1747       42     13976K dentry
 42682  42044  98%    1.01K   1394       31     44608K ext4_inode_cache
.
.
.
  3066   2943  95%    0.09K     73       42       292K kmalloc-96
  2752   2335  84%    0.12K     86       32       344K kmalloc-128
  1792   1792 100%    0.07K     32       56       128K ext4_io_end

Utilize the slabtop along with &ndash s b option to display selected objects per slab.

root@user1-linuhelp:~# slabtop -s b
Active / Total Objects (% used) : 514047 / 535102 (96.1%)
Active / Total Slabs (% used) : 11958 / 11958 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124110.82K / 128604.94K (96.5%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K

OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
6144 6144 100% 0.01K 12 512 48K kmalloc-8
0 0 0% 0.01K 0 512 0K dma-kmalloc-8
.
.
.
7680 7680 100% 0.02K 30 256 120K kmalloc-16
58 58 100% 0.27K 1 58 16K tw_sock_TCPv6
12312 10471 85% 0.55K 216 57 6912K inode_cache

Utilize slabtop along with -s c option to display selected cache size.

root@user1-linuhelp:~# slabtop -s c
Active / Total Objects (% used) : 514116 / 535038 (96.1%)
Active / Total Slabs (% used) : 11956 / 11956 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124118.66K / 128588.94K (96.5%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K

OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
42682 42044 98% 1.01K 1394 31 44608K ext4_inode_cache
12312 10471 85% 0.55K 216 57 6912K inode_cache
37502 37502 100% 0.12K 1103 34 4412K kernfs_node_cache
4420 4250 96% 0.61K 85 52 2720K proc_inode_cache
.
.
.
1421 1421 100% 0.64K 29 49 928K shmem_inode_cache
1428 1428 100% 0.62K 28 51 896K sock_inode_cache
208 188 90% 4.00K 26 8 832K kmalloc-4096

Utilize the slabtop option along with &ndash s l option for selecting number of slabs.

root@user1-linuhelp:~# slabtop -s l
Active / Total Objects (% used) : 514185 / 535038 (96.1%)
Active / Total Slabs (% used) : 11956 / 11956 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124167.26K / 128588.94K (96.6%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
129792 121946 93% 0.10K 3328 39 13312K buffer_head
73374 72481 98% 0.19K 1747 42 13976K dentry
42682 42044 98% 1.01K 1394 31 44608K ext4_inode_cache
.
.
.
928 870 93% 2.00K 58 16 1856K kmalloc-2048
1568 1412 90% 1.00K 49 32 1568K kmalloc-1024

Utilize the slabtop along with -s v option to display the active slabs.

root@user1-linuhelp:~# slabtop -s v
Active / Total Objects (% used) : 514185 / 535038 (96.1%)
Active / Total Slabs (% used) : 11956 / 11956 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124167.26K / 128588.94K (96.6%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
129792 121946 93% 0.10K 3328 39 13312K buffer_head
.
.
.
928 870 93% 2.00K 58 16 1856K kmalloc-2048
1568 1412 90% 1.00K 49 32 1568K kmalloc-1024

Utilize the slabtop along with -s n option to display the name of the cache.

root@user1-linuhelp:~# slabtop -s n
Active / Total Objects (% used) : 514317 / 535038 (96.1%)
Active / Total Slabs (% used) : 11956 / 11956 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124163.32K / 128588.94K (96.6%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K

OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
3978 3978 100% 0.04K 39 102 156K Acpi-Namespace
5656 5656 100% 0.07K 101 56 404K Acpi-ParseExt
102 102 100% 0.08K 2 51 8K Acpi-State
.
.
.
0 0 0% 2.57K 0 12 0K dm_uevent
0 0 0% 1.00K 0 32 0K dma-kmalloc-1024

Utilize the slabtop along with &ndash s o option to sort by number of objects.

root@user1-linuhelp:~# slabtop -s o
Active / Total Objects (% used) : 514286 / 535006 (96.1%)
Active / Total Slabs (% used) : 11955 / 11955 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124168.13K / 128580.94K (96.6%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K

OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
129792 121962 93% 0.10K 3328 39 13312K buffer_head
73374 72477 98% 0.19K 1747 42 13976K dentry
.
.
.
2752 2577 93% 0.12K 86 32 344K kmalloc-128
1792 1792 100% 0.07K 32 56 128K ext4_io_end

Utilize the following slabtop command along with -s p option to sort pages per slab.

root@user1-linuhelp:~# slabtop -s p
Active / Total Objects (% used) : 514289 / 535006 (96.1%)
Active / Total Slabs (% used) : 11955 / 11955 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124168.88K / 128580.94K (96.6%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
1568 1412 90% 1.00K 49 32 1568K kmalloc-1024
928 870 93% 2.00K 58 16 1856K kmalloc-2048
208 188 90% 4.00K 26 8 832K kmalloc-4096
.
.
.
1428 1428 100% 0.62K 28 51 896K sock_inode_cache
15 15 100% 2.06K 1 15 32K dmaengine-unmap-256

Utilize the slabtop command along with -s s option to sorted object size.

root@user1-linuhelp:~# slabtop -s s
Active / Total Objects (% used) : 514286 / 535006 (96.1%)
Active / Total Slabs (% used) : 11955 / 11955 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124168.13K / 128580.94K (96.6%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
236 236 100% 8.00K 59 4 1888K kmalloc-8192
0 0 0% 8.00K 0 4 0K dma-kmalloc-8192
7 7 100% 4.50K 1 7 32K net_namespace
.
.
.
30 30 100% 1.06K 1 30 32K UDPv6
0 0 0% 1.06K 0 30 0K UDPLITEv6

Utilize the slabtop command along with -s u option to sorts by the cache utilization.

root@user1-linuhelp:~# slabtop -s u
Active / Total Objects (% used) : 514318 / 535006 (96.1%)
Active / Total Slabs (% used) : 11955 / 11955 (100.0%)
Active / Total Caches (% used) : 73 / 102 (71.6%)
Active / Total Size (% used) : 124172.01K / 128580.94K (96.6%)
Minimum / Average / Maximum Object : 0.01K / 0.24K / 8.00K
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
128 128 100% 0.25K 4 32 32K kmem_cache
128 128 100% 0.06K 2 64 8K kmem_cache_node
6144 6144 100% 0.01K 12 512 48K kmalloc-8
.
.
.
1421 1421 100% 0.64K 29 49 928K shmem_inode_cache
7 7 100% 4.50K 1 7 32K net_namespace

Utilize the slabtop along with -V option to display the version.

root@user1-linuhelp:~# slabtop &ndash V
slabtop from procps-ng 3.3.9
Tag : slabtop
FAQ
Q
What option is used to display the active slabs?
A
To display the active slabs use "slabtop -s v" option.
Q
How to refresh kernel slab information with the time delay?
A
To refresh kernel slab information with time delay using "slabtop --delay=time in seconds"
Q
What is Slabtop?
A
Slabtop displays detailed kernel slab cache information in real-time. It displays a listing of the top caches sorted using the listed sort criterias. It also displays a statistics header filled with slab layer information.
Q
Is this slab cache information updated with memory leak information?
A
Memory leak information is updated on 4.7-rc1 kernel 1, it is yet to be released so we’ll have to wait for it.
Q
What is the syntax of Slabtop?
A
The syntax for Slabtop is "slabtop [options] "