IT lexicon › Programming › Memory pool

Memory pool

Programming På svenska → Updated: 2026-11-04

A pre-allocated stash of equal-sized blocks handed out and returned in constant time — malloc for people who can't afford surprises.

A general-purpose heap can serve blocks of any size, and pays for it with variable search times and fragmentation. In an RTOS both are unacceptable: a system that has run fine for three weeks must not suddenly find every free hole just short of 64 bytes. A memory pool sidesteps the problem by offering exactly one block size. Free blocks sit in a singly linked list, and allocating or freeing is just popping or pushing the head.

That is why nearly every embedded kernel has them under some name — block pools in ThreadX, memory partitions in µC/OS, memory slabs in Zephyr. Systems usually carry several pools of different sizes, each dimensioned for the worst case. Its cousin in general-purpose kernels is the slab allocator.

← Back to the lexicon