📖 WIPIVERSE

🔍 Currently registered entries: 111,229건

SLUB (software)

SLUB, or Slab Allocator, is a memory management mechanism used within operating system kernels, primarily in Linux. It is an advancement over earlier memory allocators like the Buddy System allocator and SLAB allocator, aiming to improve performance and reduce memory fragmentation.

The SLUB allocator works by pre-allocating pools of memory (slabs) dedicated to specific object sizes. This pre-allocation reduces the overhead associated with frequent allocation and deallocation of smaller objects. These slabs are populated with objects of a uniform size.

Key features and concepts associated with SLUB include:

  • Slabs: Pre-allocated memory blocks containing multiple instances of objects of the same size.
  • Object Cache: A cache associated with a particular type of object, containing slabs populated with those objects. This allows for quick retrieval of free objects of that type.
  • Partial Slabs: Slabs that contain a mix of allocated and free objects.
  • Empty Slabs: Slabs that contain only free objects and can potentially be returned to the general memory pool if necessary.
  • CPU Affinity: Attempts are made to allocate objects from the per-CPU caches to minimize inter-processor communication and improve performance on multi-core systems.

SLUB's design emphasizes simplicity and speed. It aims to minimize the number of locks required during object allocation and deallocation, a critical factor for performance in heavily threaded environments. It also reduces metadata overhead compared to older slab allocation schemes, contributing to more efficient memory utilization.

SLUB is the default slab allocator in many modern Linux distributions. While it is primarily an internal kernel component, understanding its operation can be helpful for those involved in kernel development, system performance tuning, and memory management research.