memory fragmentation
Free memory broken into many small scattered gaps, so a large block cannot be allocated even though enough memory is free in total.
In more detail
Many small allocations of different lifetimes cause it. Slab allocators and compacting garbage collectors reduce it.
Related terms
- slab allocator — A memory manager that reserves one large block up front and hands out small pieces of it, avoiding many tiny allocations.
- Mark-Sweep-Compact — V8's full garbage collection for old space: mark every object still reachable, sweep away the rest, then compact memory to close the gaps.
Taught in
- Buffer Fundamentals: Slab Allocator & V8 Memory — Node.js Internals & Backend Services