Slab allocation
Slab allocation is a memory management mechanism intended for the efficient memory allocation of objects.[src] In comparison with earlier mechanisms, it reduces fragmentation caused by allocations and deallocations.[src] This technique is used for retaining allocated memory containing a data object of a certain type for reuse upon subsequent allocations of objects of the same type.[src] It is analogous to an object pool, but only applies to memory, not other resources.[src] Slab allocation was first introduced in the Solaris 2.4 kernel by Jeff Bonwick.[src] Bonwick claims the name "Slab" comes from a Kellogg's cereal commercial catchphrase rhyme, "grab a slab".[src] Slab allocation is now widely used by many Unix and Unix-like operating systems including FreeBSD and Linux, both in the SLAB allocator and its replacement, SLUB.[src]
Slab allocation is a memory management mechanism intended for the efficient memory allocation of objects.[src] In comparison with earlier mechanisms, it reduces fragmentation caused by allocations and deallocations.[src] This technique is used for retaining allocated memory containing a data object of a certain type for reuse upon subsequent allocations of objects of the same type.[src] It is analogous to an object pool, but only applies to memory, not other resources.[src] Slab allocation was first introduced in the Solaris 2.4 kernel by Jeff Bonwick.[src] Bonwick claims the name "Slab" comes from a Kellogg's cereal commercial catchphrase rhyme, "grab a slab".[src] Slab allocation is now widely used by many Unix and Unix-like operating systems including FreeBSD and Linux, both in the SLAB allocator and its replacement, SLUB.[src] ==Implementation techniques== ===Free lists=== A slab represents one memory allocation to the cache from the machine, and whose size is customarily a multiple of the page size.[src] The slab will be divided into a number of entries, which will then be requested by the cache as the client code requests memory for new objects.[src] It is necessary then to keep track of which parts of the slab are free to use and which ones were already occupied.[src] This is generally done using "free lists": lists of free entries in the slab ready to store new objects.[src] The free list may be a separate data structure, such as an array of indices indicating which entries of the slab are free, or it may be embedded within the slab.[src] The Linux SLUB allocator keeps the free list as a linked list of pointers, each of which is stored directly in the free memory area of the slab they represent.[src] ===Slab sizes=== Operating systems may use different slab sizes and internal layouts depending on the size of the objects to be stored.[src] The reason for the large slabs having a different layout from the small slabs is that it allows large slabs to pack better into page-size units, which helps with fragmentation.[src] For example, objects that are at least 1/8 of the page size for a given machine may benefit from a "large slab" size, with explicit free lists, while smaller objects may use a "small slab" setup, embed the free list tracking.[src] Bonwick's original presentation of the slab allocator already made the distinction of layouts for large and small slabs.[src] ==See also== Fixed-size blocks allocation Memory pool ==Notes== ==External links== FreeBSD uma(9) manual page The SLUB allocator comment about management of slabs in Linux by two different allocators: SLUB allocator and SLAB allocator Memory Compaction v7 (a Linux patch set from Mel Gorman dealing with SLAB fragmentation and compaction issues, 2 April 2010) Detecting kernel memory leaks Jonathan Corbet, Linux Weekly News, 2006; includes user comments on garbage collection Linux performance: is Linux becoming just too slow and bloated?[src] On SLAB and SLUB.[src] Free software magazine 2010.[src]
27 sentences · 27 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Slab allocation." encyclopegia.org, 2026, https://encyclopegia.org/wiki/slab-allocation. Accessed 26 November 2026.
Chicago
"Slab allocation." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/slab-allocation.
APA
encyclopegia.org. (2026). Slab allocation. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/slab-allocation
Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON