Papers
Topics
Authors
Recent
Search
2000 character limit reached

Geometric Memory Allocators

Updated 3 April 2026
  • Geometric memory allocators are memory management systems that enforce strict geometric alignment, using block trees to maintain allocation state and curtail fragmentation.
  • They incorporate niche maps to enable O(log M) best-fit allocation searches, improving performance compared to traditional free-list methods.
  • Ledging decomposes non-power-of-two size requests into power-of-two chunks, allowing efficient allocations while keeping internal fragmentation low.

Geometric memory allocators are a class of memory management systems characterized by a strict geometric alignment invariant, a binary block-tree structure for allocation state, and principled handling of both power-of-two and arbitrary-size allocations. Their design directly addresses fragmentation, efficient best-fit allocation, and hardware/virtual memory generalization by leveraging hierarchical representations such as block trees and auxiliary data structures like niche maps. The underlying mechanisms have influenced both operating systems memory management and, in a distinct context, hybrid memory architectures in long-context neural models.

1. Geometric Alignment Invariant

Geometric memory allocation operates over an address space [0,2N)[0,2^N), partitioning memory into blocks of size 2k2^k that are aligned strictly on 2k2^k boundaries. A block of size 2k2^k can only begin at an address aa with 2k ∣ a2^k\,|\,a, or equivalently, a≡0(mod2k)a \equiv 0 \pmod{2^k}; this ensures the binary encoding of aa ends in kk zero bits. This alignment permits two immediately adjacent 2k2^k blocks to always coalesce into a 2k2^k0 block if, and only if, their combined starting address is itself a 2k2^k1-multiple, eliminating the "misaligned-slots" fragmentation problem common in non-geometrically-aligned allocators (Kuijper, 2015).

2. Block Trees for Allocation State

Allocation status is tracked via a balanced binary block tree of height 2k2^k2, where each node 2k2^k3 at level 2k2^k4 represents the canonical block 2k2^k5, and children correspond to its two equal halves at size 2k2^k6. Each node maintains an occupation flag 2k2^k7 indicating whether the block is wholly allocated or further subdivided. The block tree replaces traditional per-size free lists, providing a unified and recursive data structure that facilitates both memory splitting for allocation and merging upon free, constrained to maintain the geometric alignment invariant. Updates on split or merge operations propagate upward or downward in the tree, respectively, guaranteeing the structural and alignment invariants (Kuijper, 2015).

Niche maps are per-node auxiliary vectors 2k2^k8 recording lower bounds on the quantity of free blocks ("niches") at all sublevels in the subtree. Each counter 2k2^k9 is a truncated value, typically saturating at a small constant, and can be efficiently maintained via pointwise addition and update on split/merge. For allocation, the root's 2k2^k0 coefficient is accessed to check existence; descent proceeds along branches with nonzero 2k2^k1 until the desired free leaf is found. This structure admits 2k2^k2 best-fit search—significantly more efficient than first-fit schemes traversing flat free lists—and supports on-the-fly block splitting for best-fit allocation (Kuijper, 2015).

Data Structure Purpose Key Invariant
Block tree Tracks allocation Geometric alignment, binary partitioning
Niche map Fast best-fit find Accurate count of free subblocks per level

4. Ledging for Non-Power-of-Two Allocations

To accommodate arbitrary allocation sizes 2k2^k3 lacking power-of-two form, geometric allocators employ "ledging": a decomposition of 2k2^k4 into its binary expansion, allocating power-of-two chunks in decreasing order. For 2k2^k5, allocate one block per set bit 2k2^k6, top-down. This process is formalized as:

2k2^k9 Each ALLOC_BLOCK operation locates and splits as needed to allocate a 2k2^k7 block, ensuring all pieces satisfy the alignment constraint. The cost is 2k2^k8, where 2k2^k9 reflects the maximal number of power-of-two components and 2k2^k0 the traversal per ALLOC_BLOCK. Ledging guarantees internal fragmentation bounded by 2k2^k1 blocks, with asymptotic overhead per large request approaching a constant factor of 2k2^k2 (Kuijper, 2015).

5. Fragmentation, Time, and Space Complexity

The geometric allocation strategy strictly limits external fragmentation: misaligned coalesces are explicitly forbidden, and fragmentation can occur only at aligned boundaries, reproducing (and often improving on) the asymptotic bound of the buddy system (at most half memory in each size class can become stranded). Internal fragmentation arising from ledging is logarithmic in the request size. The time complexity for allocation and deallocation is 2k2^k3 per power-of-two operation, with total cost for arbitrary 2k2^k4 given by 2k2^k5. Sparse tree storage ensures that space overhead tracks actual splits and allocations, not the theoretical maximum for the full tree. Each node requires a single bit for occupation plus 2k2^k6 bits for niche maps (Kuijper, 2015).

6. Extensions: Virtual Memory and Hardware Implementation

The block-tree and niche-map abstraction generalizes to backing virtual address spaces ("vtree"), where each node signals whether its range is mapped to real memory. Virtual allocations leverage ledging to create exact fixed-size mappings, and "geometric paging" can be implemented by demand-growing blocks and mapping only when required. These trees admit pipelined hardware implementations: each pipeline stage manipulates only the relevant levels of nodes, passing tokens to prevent request collisions, allowing parallel and high-throughput allocation and mapping. Both real (rtree) and virtual (vtree) memory block trees can share this infrastructure (Kuijper, 2015).

7. Comparative Analysis with Classical Allocators

Geometric memory allocators offer a stronger alignment invariant than classical buddy or first-fit allocators, eliminating misaligned-slot fragmentation and guaranteeing coalescence as soon as contiguous and aligned regions are free. Niche maps enable 2k2^k7 best-fit search without scanning free lists. Ledging supports arbitrary sizes efficiently, and the block-tree framework extends seamlessly to virtual and physical memory contexts as well as hardware. The primary trade-off is increased bookkeeping complexity relative to simple free lists, and a deliberate restriction on coalescing, which in practice improves long-term system fragmentation at the expense of possibly leaving some larger blocks temporarily stranded. In contrast to 2k2^k8 free-list pop/push, all geometric operations are logarithmic but well suited to pipelining and hardware acceleration (Kuijper, 2015).


Geometric memory allocators, by enforcing strict block alignment, representing allocation in recursive block trees, augmenting with niche maps, and handling arbitrary request sizes via ledging, provide a theoretically robust and practically efficient alternative to legacy allocation strategies. Their design principles generalize naturally to virtual memory and hardware, anchoring their relevance not only in system software but also in contexts demanding scalable, structured memory access (Kuijper, 2015).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Geometric Memory Allocators.