Glossary — in plain language

AllocSet allocator

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

In plain English

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.

Why it matters

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.

Was this helpful?

← Browse the full glossary