slabtop

The slabtop command shows detailed kernel slab cache information in real time. It displays aggregate statistics for all caches on the top frame and a detailed list beneath.

.Active / Total Objects (% used)    : 4022606 / 4075871 (98.7%)
.Active / Total Slabs (% used)      : 108200 / 108200 (100.0%)
.Active / Total Caches (% used)     : 87 / 116 (75.0%)
.Active / Total Size (% used)       : 931698.02K / 944745.29K (98.6%)
.Minimum / Average / Maximum Object : 0.01K / 0.23K / 16.00K
.
. OBJS ACTIVE  USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
420960 420960 100%    1.00K 13155       32    420960K xfs_inode
771498 771107  99%    0.19K 36738       21    146952K dentry
135018 128584  95%    0.59K 5193        26     83088K proc_inode_cache
116900 114734  98%    0.57K 4175        28     66800K radix_tree_node
955072 950316  99%    0.06K 14923       64     59692K kmalloc­64
581604 574153  98%    0.08K 11404       51     45616K Acpi­State
287976 285123  99%    0.10K 7384        39     29536K buffer_head
101478 101478 100%    0.15K 3903        26     15612K xfs_ili
.19401  19349  99%    0.54K 669         29     10704K inode_cache
.23940  23719  99%    0.38K 1140        21      9120K mnt_cache
.41866  38205  91%    0.18K 1903        22      7612K vm_area_struct
.19072  16103  84%    0.25K 596         32      4768K kmalloc­256
142592 137537  96%    0.03K 1114       128      4456K kmalloc­32
.36142  34506  95%    0.12K 1063        34      4252K kernfs_node_cache
..4650   4131  88%    0.62K 186         25      2976K shmem_inode_cache
122740 122740 100%    0.02K 722        170      2888K scsi_data_buffer
720    593  82%    4.00K 90           8      2880K kmalloc­4096
..2752   2526  91%    1.00K 86          32      2752K kmalloc­1024
..1248   1073  85%    2.00K 78          16      2496K kmalloc­2048
900    781  86%    2.47K 75          12      2400K task_struct
..9975   8711  87%    0.19K 475         21      1900K kmalloc­192
.16107  15582  96%    0.10K 413         39      1652K blkdev_ioc
720    720 100%    2.05K 48          15      1536K idr_layer_cache
.11808  10668  90%    0.12K 369         32      1476K kmalloc­128
..2944   2724  92%    0.50K 92          32      1472K kmalloc­512
..3132   2807  89%    0.44K 87          36      1392K i915_gem_object
.14196  14196 100%    0.09K 338         42      1352K kmalloc­96
.16524  14770  89%    0.08K 324         51      1296K anon_vma
570    506  88%    2.06K 38          15      1216K sighand_cache
.73216  70964  96%    0.02K 286        256      1144K kmalloc­16
..1365    946  69%    0.81K 35          39      1120K task_xstate
136    130  95%    8.00K 34           4      1088K kmalloc­8192
..1152   1020  88%    0.88K 32          36      1024K RAW
..1500   1379  91%    0.62K 60          25       960K sock_inode_cache
784    653  83%    1.12K 28          28       896K signal_cache
.97280  97280 100%    0.01K 190        512       760K kmalloc­8
512    512 100%    0.98K 16          32       512K ext4_inode_cache
224    164  73%    2.00K 14          16       448K TCP
..5768   5709  98%    0.07K 103         56       412K Acpi­ParseExt
..3240   3240 100%    0.11K 90          36       360K Netatop_sockinfo
..1435   1435 100%    0.23K 41          35       328K cfq_queue
312     59  18%    0.81K 8           39       256K bdev_cache
272    272 100%    0.94K 8           34       256K UDP
240    240 100%    1.06K 8           30       256K UDPv6
..5100   5015  98%    0.05K 60          85       240K ftrace_event_field
750    654  87%    0.31K 30          25       240K nf_conntrack_ffffffff81cfa400
210    210 100%    1.06K 7           30       224K dmaengine­unmap­128
112     32  28%    1.90K 7           16       224K blkdev_queue
..5100   5100 100%    0.04K 50         102       200K Acpi­Namespace
300    300 100%    0.62K 12          25       192K files_cache
….42     21  50%    4.44K 6            7       192K net_namespace
..1932   1862  96%    0.09K 42          46       168K ftrace_event_file
420    380  90%    0.39K 21          20       168K xfs_efd_item
….70     56  80%    2.17K 5           14       160K pid_namespace
352    288  81%    0.36K 16          22       128K blkdev_requests

The output above is sorted by cache size but it can be changed interactively by pressing:

  • character      description                        header

    a                    number of active objects     ACTIVE

    b                    objects per slab                   OBJ/SLAB

    c                    cache size                           CACHE SIZE

    l                     number of slabs                  SLABS

    v                    number of active slabs        N/A

    n                    name                                   NAME

    o                    number of objects               OBJS

    p                    pages per slab                    N/A

    s                    object size                           OBJ SIZE

    u                    cache utilization                  USE

The default output is interactive and the refresh interval is 3 seconds. From the command line we can change the refresh interval and sort criteria with the -d and -s flags respectively. We can also get the output in a non-interactive manner by sending it to stdout (screen or file) with the -o flag.

<< netstat                     ipcs, ipcmk & ipcrm >>