Free block Selected Allocated
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Buddy Memory Allocator

The buddy system is the power-of-two memory allocator behind the Linux kernel's page allocator and generations of Unix kmem subsystems before it. This simulator models a real 256 KB pool as a live 3D block map: request a chunk of memory and watch the allocator repeatedly halve the smallest sufficient free block until it produces one of exactly the right power-of-two size, then free any allocated block and watch it recursively merge with its buddy — and its buddy's buddy — the instant both sides are free again. Live readouts track free and allocated memory, the internal fragmentation wasted by rounding requests up to a power of two, and how many blocks currently partition the pool.