HomeComputer ScienceBuddy Memory Allocator

Buddy Memory Allocator

Interactive 3D buddy memory allocator: request and free blocks of RAM, watch the power-of-two splitting and buddy-merging happen live, and track internal fragmentation in real time.

Computer Science3DModerate60 FPS📱 Mobile-adapted⇄ 2D version
operating-systems-computer-science-2 ↗ Open standalone

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.

⚙ Under the hood

Interactive 3D buddy memory allocator: request and free power-of-two blocks from a 256 KB pool and watch the recursive splitting and buddy-merging happen live, with internal fragmentation tracked in real time.

operating systemsmemory managementbuddy allocatorkernelalgorithmsfragmentation

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)