Display Linux kernel slab cache information in real time

Linux has tons of frequently used objects in the kernel such as buffer heads, inodes, dentries, etc. and have their own cache. The file /proc/slabinfo (less /proc/slabinfo) gives statistics. It is possible that slab cache information can be used to debug kernel problems (see crash command man page for more info).

ADVERTISEMENTS

slabtop command displays detailed kernel slab cache information in real time. It displays a listing of the top caches sorted by one of the listed sort criteria. It also displays a statistics header filled with slab layer information.

It generates output like vmtop perl script but in real time:

$ vmtop

VMTOP output:

Memory:    750.6 Mb      Free:   2.2%    Buffers:  56.1%   Cached:   3.1%
                       Active:  69.3%   Inactive:  24.0%
Lowmem:    750.6 Mb      Free:   2.2%       Slab:   3.0%   Memmap:   0.0%
                       Stacks:   0.1%       PMDs:   0.0%     PTEs:   0.3%

Top slabs:
      size-131072(dma)       0.1 Mb  (Active:      0.0 Mb,   0.0% full)
           size-131072       0.1 Mb  (Active:      0.0 Mb,   0.0% full)
       size-65536(dma)       0.1 Mb  (Active:      0.0 Mb,   0.0% full)
            size-65536       0.1 Mb  (Active:      0.0 Mb, 100.0% full)
       size-32768(dma)       0.0 Mb  (Active:      0.0 Mb,   0.0% full)

Now let us see output of slabtop command:

$ slabtop

slabtop command output:

slabtop command output
(Click to enlarge)

See also:

  • Read man page of slabtop for SORT CRITERIA related information (the default sort criteria is to sort by the number of objects).
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • xuedi Mar 7, 2011 @ 12:13

    Hello there,

    awesome tools, is there a way also to find out WHO is allocation the memory, i see a HUGE ammount of size-32 slaps growing over the weeks…

    Cheers,
    xuedi

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.