arXiv:2608.28462cs.DSAug 2026

Manuscript Offprint

arXiv:2608.28462

Tight Bounds for Memory Allocation With and Without Request Fragmentation

Michael A. Bender, Alex Conway, Martín Farach-Colton, Hanna Komlós, William Kuszmaul, Nicole Wein

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Michael A. Bender

Stony Brook University

bender@cs.stonybrook.edu

Hanna Komlós

Max Planck Inst. for Informatics

hkomlos@gmail.com

Alex Conway

Cornell University

me@ajhconway.com

William Kuszmaul

Carnegie Mellon University

kuszmaul.cmu.edu

Martín Farach-Colton

New York University

martin@farach-colton.com

Nicole Wein

University of Michigan

nswein@umich.edu

Abstract

The classical memory-allocation problem captures the task of placing objects of different sizes in memory, while minimizing the so-called memory high-water mark. It has been known since the early 1970s that the optimal competitive ratio for any deterministic online allocator is Θ(log⁡M)\Theta(\log M), where M is the volume high-water mark of the underlying request sequence.

This paper begins with a simple observation: many real-world allocators seem to bypass the 1971 lower bound by adopting a slightly different model for memory allocation. These allocators use what we call k-aggregate request fragmentation, meaning that the memory allocator is permitted to break requests into multiple fragments, so long as the all-time maximum number of simultaneous fragments is at most k times the all-time maximum number of simultaneous requests.

We consider the following basic question: Does request fragmentation fundamentally change the problem of memory allocation, and if so, how? Our results come with several surprises. Among these, we find that even using k=1+o(1)k = 1 + o(1) request fragmentation, the optimal competitive ratio—which was Θ(log⁡M)\Theta(\log M) in the classical setting—collapses to Θ(log⁡log⁡M)\Theta(\log \log M). This result is shown to be tight with matching upper and lower bounds, applying to both deterministic and randomized algorithms.

1 Introduction

Introduced in the early 1960s and 70s [15,37,41–43,52], the memory allocation problem 1^{1} is one of the oldest and most basic problems in computer science.

In its classical form, a memory allocator must support two operations: a memory request, which specifies some size s>0s > 0, and requires an allocation of ss consecutive free slots in memory; and a memory free, which specifies some previous request, and frees the slots formerly allocated to that request. Memory is represented as an unbounded one-dimensional array, and the goal of the allocator is to satisfy the given input sequence using as small a prefix of memory as possible.

Formally, given an input sequence WW (also known as a workload), and a memory allocation algorithm A\mathcal{A}, the memory high-water mark S(A,W)\mathbf{S}(\mathcal{A}, \mathbf{W}) is defined to be the smallest q≥0q \geq 0 such that all of A\mathcal{A}'s allocations on WW use slots in the interval [1,q][1, q]. The goal is to keep S(A,W)S(\mathcal{A}, W) as close as possible.

1^{1}Also known as “online memory allocation”, “dynamic memory allocation” and “storage allocation” to the so-called volume high-water mark M(W), which is the maximum, over all times t, of the sum of the sizes of the live requests at time t.2t.^{2}

Classical results: bounds for both deterministic and randomized algorithms. An ideal algorithm would achieve competitive ratio S(A,W)/M(W)S(\mathcal{A}, W)/M(W) of O(1)O(1) on all workloads W. However, in a classic 1971 paper, Robson [41] showed that no such (deterministic) algorithm exists. In fact, as a function of M=M(W)M = M(W), the best competitive ratio achievable by any deterministic algorithm is Θ(log⁡M)3\Theta(\log M)^{3}. This bound can be achieved by algorithms that do not know M, and is optimal even for algorithms that do know M in advance.

This discovery led researchers to explore two main directions, the task of optimizing the constants in Robson’s Θ(log⁡M(W))\Theta(\log M(W)) bound [36, 43, 52], and the question of whether randomized algorithms might be able to do better [36]. Interestingly, it has remained an open question whether randomized algorithms might be able to beat deterministic ones. The best lower bound, due to Luby, Naor and Orda in 1994 [36], is a bound of Ω(log⁡M/log⁡log⁡M)\Omega(\log M/\log \log M) which holds for the competitive ratio of any randomized algorithm, and which, again, holds regardless of whether or not the algorithm knows M in advance. 4^{4}

The modern approach: request fragmentation. In practice, researchers and practitioners have been able to bypass Robson's lower bound by allowing the allocation algorithm to perform request fragmentation, in which the algorithm splits a request into multiple fragments that are each allocated in different parts of memory.

Perhaps the most famous application of request fragmentation is at the operating-system level [2,45,49]. When a program (or heap allocator) requests memory of some size s, modern operating systems break the request into fragments of different sizes (each fragment corresponds to a fixed-sized “page” or “huge page” in the operating system) and places these fragments non-contiguously in memory. The operating system then hides this fragmentation from the user, by assigning the fragments virtual addresses that appear contiguous, even though the physical addresses are not.

Given that modern allocators are capable of performing request fragmentation, one might wonder: Why not take this approach to the extreme? Why not, for example, break each request of size s into s different fragments each of size 1? To see the problem with such an approach, it is helpful to once again consider the operating-system example. To support request fragmentation, the operating system must store a data structure called the page table that maps the virtual address of each fragment to its physical address. Not only does the page table need to fit in RAM, it should ideally also fit in a relatively small hardware cache. But the size of the page table is directly proportional to the total number of fragments in the system.

Thus, even if an allocator performs request fragmentation, it should seek to minimize the total number of fragments that are present at a time. With this goal in mind, we say that an allocator A uses k-aggregate fragmentation if, on every workload W, the maximum number of fragments that are ever live at once is at most k⋅Q(W)k \cdot Q(W), where Q(W)Q(W) is the maximum number of requests that are ever live at once.

It is worth taking a few words to remark on why k-aggregate fragmentation is a natural notion to consider. This definition models the very practical capacity constraint of minimizing the size of the data structure needed to index fragments, which is determined by the maximum number of fragments ever in the system. In a non-fragmented allocator, the size required for the index would simply be the peak number of jobs ever alive in the system, so the ratio k captures how the size complexity of the

2^{2}This quantity M(W)M(W) turns out to be equivalent, up to constant factors, to S(OPT,W)S(\text{OPT}, W), where OPT is the offline optimal allocation algorithm [7, 20, 21, 27, 28, 48].

3^{3}All logarithms in this paper are base 2.

4^{4}The classical lower bounds are often stated in terms of other parameters, such as the request high-water mark or the ratio of the largest to the smallest request sizes. In their constructions and ours, all of these parameters differ by a constant factor.

fragment index scales with respect to a) the input to the index, i.e., the number of jobs it must support, and b) an analogous unfragmented index. An ideal allocator should use k-aggregate fragmentation for some small k (perhaps even k=1+o(1)k = 1 + o(1)).

Although request fragmentation is widely used in practice, the question of how well it performs in theory has remained largely unexplored. How large does k need to be in order for k-aggregate request fragmentation to break Robson's Ω(log⁡M)\Omega(\log M) lower bound? And, if request fragmentation does break Robson's lower bound, then what is the new best bound that one can achieve?

This paper: Tight bounds for both classical and fragmented memory allocation. The goal of this paper is to develop tight bounds for both deterministic and randomized memory allocation, with and without k-aggregate fragmentation. We summarize the results for the different regimes we study in Table 1.

We give matching upper and lower bounds on the best competitive ratio that any allocation algorithm (deterministic or randomized) can achieve using k-aggregate fragmentation. Supposing k≥2k \geq 2, and given a known upper bound M‾≥1\overline{M} \geq 1 on M(W)M(W), we show that the optimal competitive ratio for any algorithm is

Θ(log⁡klog⁡M‾).(1)\Theta(\log_{k}\log\overline{M}). \tag{1}

Our upper bound is achieved by a simple deterministic algorithm that does not need to know M‾\overline{M} in advance, while our lower bound applies to all randomized algorithms, including those that know M‾\overline{M} in advance. The lower bound is proven by combining the techniques which we use to prove (4) with another entirely separate set of arguments that capture the limitations of request fragmentation.

We remark that the tradeoff given by (1) comes with several significant surprises. First, on the upper-bound side, it says that even a very small amount of fragmentation (k=O(1))(k = O(1)) is enough to trigger an exponential collapse in the competitive ratio, as a function of M‾5\overline{M}^5. Second, on the lower-bound side, it says that using large values of kk comes with a comparably shallow payoff—increasing kk to be ω(1)\omega(1) divides the optimal competitive ratio by a relatively meager factor of Θ(log⁡k)\Theta(\log k).

We also generalize (1) in several ways. First, to the setting where k=1+εk = 1 + \varepsilon for some ε∈(0,1)\varepsilon \in (0,1), where we find that the optimal competitive ratio becomes

Θ(log⁡log⁡M‾+log⁡ε−1).\Theta(\log\log\overline{M}+\log\varepsilon^{-1}).

This means that, even using kk as small as 1+1/polylogM‾1+1/\text{polylog}\overline{M} is enough to collapse the optimal competitive ratio to Θ(log⁡log⁡M‾)\Theta(\log\log\overline{M}). Second, we extend our results to the setting where MM is known to be in a restricted range [Mmin⁡,Mmax⁡][M_{\min}, M_{\max}], and where Mmax⁡/Mmin⁡=RM_{\max}/M_{\min} = R for some parameter RR.6^{6} In this case, we show that, for k>1k > 1 and R≥1R \geq 1, the optimal competitive ratio becomes

{Θ(1+log⁡klog⁡R)ifk≥2Θ(log⁡log⁡R+log⁡(k−1)−1)ifk∈(1,2).(2)\begin{cases}\Theta(1+\log_{k}\log R)&if k\geq2\\\Theta(\log\log R+\log(k-1)^{-1})&if k\in(1,2).\end{cases} \tag{2}

A notable special case is the setting where M(W)M(W) is fully known in advance (i.e., R=1R = 1). In this case, for k=Θ(1)k = \Theta(1), the optimal competitive ratio drops to O(1)O(1). In contrast, in the classical setting, the optimal competitive ratio would remain at Ω(log⁡M(W))\Omega(\log M(W)) (by (4)).

Finally, we also consider a stronger notion of request fragmentation, called k-per-request fragmentation, in which the allocator is permitted to break each individual request into up to k

5^{5}In most operating-system level applications, where memory is typically restricted to fit in, say, a 32 GB RAM, and where memory is measured in 64-bit words, one can trivially obtain a bound on M‾\overline{M} of, say 2322^{32}, which for k=3k = 3 gives log⁡klog⁡M‾≈3.1\log_k \log \overline{M} \approx 3.1.

6^{6}Interestingly, our algorithms for this setting, given by Theorems 6.3 and 6.4, actually require knowledge only of Mmin⁡M_{\min}, and not of Mmax⁡M_{\max} or R.

fragments, but cannot break any request into more than that. Note that k-per-request fragmentation trivially cannot improve the optimal competitive ratio (4) by more than a factor of k, since any request of size s must have a fragment of size at least s/ks/k – and even if we allocated these fragments alone, our memory-high water mark would be at least Ω(1kMlog⁡M)\Omega(\frac{1}{k}M \log M), resulting in a competitive ratio of at least Ω(k−1log⁡M)\Omega(k^{-1} \log M). Our main result for k-per-request fragmentation is that, in fact, even this factor of k is overly optimistic. We show that, using k-per-request fragmentation, the optimal competitive ratio (for both deterministic and randomized algorithms) is given by

Θ(log⁡k+1M),(3)\Theta(\log_{k+1}M), \tag{3}

regardless of whether or not any information about M=M(W)M = M(W) is known in advance.

The contrast between Equations (1) and (3) provides a strong theoretical justification for why, in practice, modern allocators (implicitly) use k-aggregate fragmentation instead of k-per-request fragmentation. The bounds achieved by the former are (at least) exponentially better than those achievable by the latter.

From our lower bound for k-per-request fragmentation, we also obtain as a corollary an improved lower bound for classical (non-fragmented) memory allocation. We prove that any randomized algorithm must incur a competitive ratio of at least

Ω(log⁡M),(4)\Omega(\log M), \tag{4}

even if M=M(W)M = M(W) is given to the algorithm in advance. Although this result closes the modest log log M gap that remained after the randomized lower bound of Luby, et al. [36], it is nevertheless an interesting byproduct of our analysis to settle the main conjecture in [36] and demonstrate that there is no asymptotic advantage to using randomization for classical memory allocation.

Finally, in Section A, we also consider several other notions of fragmentation that, a priori, might seem different, and we prove reductions showing that these are essentially equivalent to per-request fragmentation.

Together, our results paint, for the first time, a complete picture of what the landscape of memory-allocation algorithms look like, both for deterministic and randomized algorithms, with and without memory fragmentation. Our results reveal that the use of k-aggregate fragmentation, even for very small values of k, results in a near total collapse of the classical lower bounds – thereby justifying why real-world allocators have converged to this solution in practice. Our results further demonstrate that different types of fragmentation (k-aggregate vs k-per-request) result in very different tradeoff curves, meaning that almost all of the algorithmic value to be obtained from fragmentation requires different requests to be broken into different amounts of fragments. Finally, our results reveal that randomization, despite offering an advantage in other related settings such as paging [17,46], offers no asymptotic advantage for memory allocation.

Related work. The problem of dynamic storage allocation first came to prominence in the academic literature in 1961, when Communications of the ACM published a special issue focusing exclusively on the topic [1]. In that issue Collins initiated the experimental study of several algorithms that remain popular today, including First Fit, Best Fit, Worst Fit, and Random Fit [15]. Another popular algorithm, the buddy allocator was invented in 1963 by Markowitz and first described by Knowlton in 1965 [29,30]. In 1968, Knuth's The Art of Computer Programming, Vol. 1, dedicated a section to Dynamic Storage Allocation, fully codifying the problem and standardizing much of the terminology [31].

The modern formulation of the problem, in terms of competitive ratios, was introduced by Robson in 1971 [41–43], and independently by Woodall in 1974 [52]. Both authors [41,52] proved matching Θ(log⁡M)\Theta(\log M) upper and lower bounds for the best competitive ratio of any deterministic algorithm. Robson [42] further determined sharp worst-case bounds for the competitive ratios achieved by the Best Fit and First Fit algorithm. His results came with several concrete lessons that continue to impact practice

FragmentationParameter RangeBound TypeCompetitive RatioReference
NoneN/AUpperO(log⁡M)O(\log M)[42]
NoneN/ALowerΩ(log⁡M)\Omega(\log M)Corollary 4.4
kk-per requestk≥1k\ge 1UpperO(log⁡kM)O(\log_k M)Theorem 4.3
kk-per requestk≥1k\ge 1LowerΩ(log⁡kM)\Omega(\log_k M)Corollary 4.2
kk-aggregatek≥2k\ge 2UpperO(log⁡klog⁡(M‾))O(\log_k \log(\overline{M}))Theorem 3.5
kk-aggregatek≥2k\ge 2LowerΩ(log⁡klog⁡(M‾))\Omega(\log_k \log(\overline{M}))Theorem 3.3
(1+ε)(1+\varepsilon)-aggregateε∈(0,1)\varepsilon\in(0,1)UpperO(log⁡log⁡M‾+log⁡ε−1)O(\log \log \overline{M}+\log \varepsilon^{-1}))Theorem 3.6
(1+ε)(1+\varepsilon)-aggregateε∈(0,1)\varepsilon\in(0,1)LowerΩ(log⁡log⁡M‾+log⁡ε−1)\Omega(\log \log \overline{M}+\log \varepsilon^{-1}))Corollary 3.4

Table 1: Summary of Results for Different Types of Fragmentation. Bounds are given as competitive ratios to an offline optimal algorithm, which has memory high-water mark Θ(M)\Theta(M), where MM is the volume high-water mark (the maximum number of simultaneously occupied memory slots at any time) of the workload. For kk-aggregate fragmentation, M‾\overline{M} denotes an upper bound on MM.

today. Notably, the Best Fit algorithm, which may intuitively seem like a good heuristic, can incur a competitive ratio as bad as Ω(M)\Omega(M); while the First-Fit algorithm, which might intuitively seem like a worse algorithm, achieves an asymptotically optimal competitive ratio of O(log⁡M)O(\log M).

In the 1980s and 90s, it became increasingly clear that, for many online problems (e.g., the closely related online paging problem [17, 46]), randomization can be used to bypass barriers that deterministic algorithms face. Luby, Naor, and Orda raised the question of whether randomized allocation algorithms might achieve a better competitive ratio than Θ(log⁡M)\Theta(\log M) [36]. The authors [36] were able to prove a lower bound of Ω(log⁡M/log⁡log⁡M)\Omega(\log M/\log \log M), and conjectured the stronger lower bound of Ω(log⁡M)\Omega(\log M) proven as one of the results in this paper.

Dynamic storage allocation is closely related to several other combinatorial scheduling problems. In 1983, Coffman connected dynamic storage allocation to dynamic bin packing [3, 12, 25], and there has been a line of research in this direction [8, 11–14, 18]. This connection can be explicitly seen through a “rectangle view,” where one axis is memory address and the other is time [9]. Surprisingly, recent work suggests that bin-packing algorithms may even yield good allocators in practice [33]. There is also a strong connection to online interval coloring [40], which has influenced several of the results on dynamic storage allocation.

Another version of the problem that has been studied is the known-duration version, where the algorithm is told each request’s duration on arrival [26, 39]. Perhaps surprisingly, this version of the problem continues to be subject to a Ω~(log⁡M)\tilde{\Omega}(\log M) lower bounds on the competitive ratio [26].

The offline version of the problem has also received a great deal of attention [7, 19–21, 27, 28, 47, 48]. It is known to be NP-Complete [19, 47], and much of the research has focused on achieving increasingly better approximation ratios. Early work by Kierstead and Slusarek relied on the connection to interval coloring [27, 28, 48], but Gergov showed that better approximation ratios than those implied by that problem are possible [20, 21], including the best-known 3-approximation.

Finally, researchers have also studied many other variations of the problem, such as dynamic storage re-allocation [4–6, 16, 16, 22, 23, 32, 35, 44, 50], allocation with restrictions on request sizes [7, 20, 34, 38], and allocation under stochastic arrivals and departures [10].

References (31)