slabtop
Show kernel slab cache information
SYNOPSIS
slabtop [options]
PARAMETERS
-d, --delay <N>
Specifies the delay in seconds between updates when running in interactive mode. Default is 3 seconds.
-o, --once
Displays the slab cache information once and then exits, instead of running in interactive mode.
-s, --sort <KEY>
Sorts the output by the specified KEY. Common keys include 'name', 'active', 'objsize', 'objs' (total objects), and 'slabs' (number of slabs).
-r, --reclaim-order
Displays information about the reclaim order of the slab caches (less commonly used).
-h, --help
Displays a brief help message and exits.
-v, --version
Displays the version information for slabtop and exits.
DESCRIPTION
slabtop is a command-line utility that displays real-time information about the Linux kernel's slab caches.
The kernel uses slab allocation to manage memory for frequently used data structures, which helps reduce fragmentation and overhead. slabtop reads data from /proc/slabinfo and presents it in an easy-to-read, interactive format, similar to top. It shows details such as the number of active objects, total objects, object size, and memory consumed by each slab cache.
This tool is invaluable for system administrators and kernel developers to identify memory leaks, understand kernel memory usage patterns, and debug performance issues related to kernel memory allocation.
CAVEATS
slabtop typically requires root privileges (or `sudo`) to access the /proc/slabinfo file and display kernel slab information.
The output columns and available sort keys might slightly vary depending on the Linux kernel version and the version of the slabtop utility itself.
Interpreting the output effectively requires some understanding of kernel memory management and slab allocation concepts.
OUTPUT INTERPRETATION
When slabtop runs, it displays several columns of data for each slab cache:
Cache: The name of the slab cache.
Objs: Total number of objects currently allocated in this cache.
Active: Number of objects that are currently in use.
Objsize: The size of each object (in bytes) within this cache.
Slabs: The number of slabs (contiguous memory blocks) that make up this cache.
Obj/Slab: The number of objects that fit into a single slab.
Total: The total memory (in KB or MB) consumed by the cache (Objects * Object Size).
HISTORY
slabtop is part of the procps-ng suite of utilities, which are standard tools for monitoring and managing Linux system processes and resources. It has been a long-standing utility for system administrators and kernel developers, providing crucial insights into kernel memory usage that complement higher-level memory tools.