$linuxjunkies
>

slabtop(1)

Display kernel slab cache statistics in real-time, showing memory usage of kernel objects.

UbuntuDebianFedoraArch

Synopsis

slabtop [OPTION]...

Description

slabtop displays real-time information about kernel slab caches, showing how much memory is consumed by different kernel data structures. It reads from /proc/slabinfo and updates dynamically, similar to top(1) but for kernel memory allocations.

Kernel objects like inodes, dentries, and network buffers are allocated from slab caches. slabtop helps identify memory leaks and understand kernel memory usage patterns.

Common options

FlagWhat it does
-d DELAYRefresh interval in seconds (default: 3)
-s SORTSort by: a(active), b(bytes), c(cache), l(loss), o(objects), p(pages), s(slabs), u(use) (default: c)
-oOne-shot mode: print output once and exit, do not update
-n NUMShow NUM slab caches (default: 10)
-S SORTSort in descending order by specified metric
--sort=SORTLong option form for sorting criteria
--delay=DELAYLong option form for refresh interval
-h, --helpDisplay help message and exit

Examples

Show top 10 slab caches sorted by cache size, updating every 3 seconds

slabtop

Print slab statistics once and exit (useful in scripts)

slabtop -o

Show top 20 slab caches sorted by bytes used in descending order

slabtop -s b -n 20

Refresh every 1 second, sorting by number of active objects

slabtop -d 1 -s o

Display 5 caches with highest usage percentage

slabtop -s u -n 5

One-shot output of top 20 slab caches by memory consumption

slabtop -o -s b | head -20

Related commands