Memory

AllocSet allocator

Also called: AllocSet, aset.c, block/chunk allocator

The AllocSet (in aset.c) is the default memory-context implementation behind palloc. It requests OS memory in blocks that grow geometrically, carves them into chunks for individual allocations, and keeps freed chunks on 11 power-of-two freelists (8 B to 8 KB) for reuse. Allocations above the chunk limit get their own dedicated block.

What this means

The default engine behind palloc. It grabs OS memory in ever-larger blocks, chops them into chunks for individual allocations, and keeps freed chunks on size-bucketed free-lists to hand out again. Anything bigger than a chunk skips all that and gets its own dedicated block.

Why it matters operationally

This design makes palloc much cheaper than raw malloc and makes resetting a context nearly free, you just release the blocks. It is why PostgreSQL can allocate aggressively per query and reclaim it all instantly.

← All glossary terms · GUC reference · Error catalog