slab allocator

A memory manager that reserves one large block up front and hands out small pieces of it, avoiding many tiny allocations.

In more detail

Node.js keeps an 8 KiB pool, set by Buffer.poolSize, for Buffer.allocUnsafe() and Buffer.from(): requests smaller than half the pool, under 4 KiB, are cut from it. Keeping even a tiny slice alive keeps the whole 8 KiB block from being freed.

Related terms

Taught in

References