Manuscript Offprint
arXiv:2608.28462Tight Bounds for Memory Allocation With and Without Request Fragmentation
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Michael A. Bender
Stony Brook University
Hanna Komlós
Max Planck Inst. for Informatics
Alex Conway
Cornell University
William Kuszmaul
Carnegie Mellon University
kuszmaul.cmu.edu
Martín Farach-Colton
New York University
Nicole Wein
University of Michigan
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 , 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 request fragmentation, the optimal competitive ratio—which was in the classical setting—collapses to . 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 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 , and requires an allocation of 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 (also known as a workload), and a memory allocation algorithm , the memory high-water mark is defined to be the smallest such that all of 's allocations on use slots in the interval . The goal is to keep as close as possible.
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
Classical results: bounds for both deterministic and randomized algorithms. An ideal algorithm would achieve competitive ratio of 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 , the best competitive ratio achievable by any deterministic algorithm is . 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 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 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.
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 , where 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
This quantity turns out to be equivalent, up to constant factors, to , where OPT is the offline optimal allocation algorithm [7, 20, 21, 27, 28, 48].
All logarithms in this paper are base 2.
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 ).
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 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 , and given a known upper bound on , we show that the optimal competitive ratio for any algorithm is
Our upper bound is achieved by a simple deterministic algorithm that does not need to know in advance, while our lower bound applies to all randomized algorithms, including those that know 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 is enough to trigger an exponential collapse in the competitive ratio, as a function of . Second, on the lower-bound side, it says that using large values of comes with a comparably shallow payoff—increasing to be divides the optimal competitive ratio by a relatively meager factor of .
We also generalize (1) in several ways. First, to the setting where for some , where we find that the optimal competitive ratio becomes
This means that, even using as small as is enough to collapse the optimal competitive ratio to . Second, we extend our results to the setting where is known to be in a restricted range , and where for some parameter . In this case, we show that, for and , the optimal competitive ratio becomes
A notable special case is the setting where is fully known in advance (i.e., ). In this case, for , the optimal competitive ratio drops to . In contrast, in the classical setting, the optimal competitive ratio would remain at (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
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 of, say , which for gives .
Interestingly, our algorithms for this setting, given by Theorems 6.3 and 6.4, actually require knowledge only of , and not of 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 – and even if we allocated these fragments alone, our memory-high water mark would be at least , resulting in a competitive ratio of at least . 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
regardless of whether or not any information about 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
even if 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 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
| Fragmentation | Parameter Range | Bound Type | Competitive Ratio | Reference |
| None | N/A | Upper | [42] | |
| None | N/A | Lower | Corollary 4.4 | |
| -per request | Upper | Theorem 4.3 | ||
| -per request | Lower | Corollary 4.2 | ||
| -aggregate | Upper | Theorem 3.5 | ||
| -aggregate | Lower | Theorem 3.3 | ||
| -aggregate | Upper | ) | Theorem 3.6 | |
| -aggregate | Lower | ) | 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 , where is the volume high-water mark (the maximum number of simultaneously occupied memory slots at any time) of the workload. For -aggregate fragmentation, denotes an upper bound on .
today. Notably, the Best Fit algorithm, which may intuitively seem like a good heuristic, can incur a competitive ratio as bad as ; while the First-Fit algorithm, which might intuitively seem like a worse algorithm, achieves an asymptotically optimal competitive ratio of .
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 [36]. The authors [36] were able to prove a lower bound of , and conjectured the stronger lower bound of 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 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].
Formally, the online memory allocation problem is defined as follows. The input is a workload, consisting of an arbitrary sequence of memory requests and memory frees (or requests and frees for short). Memory is represented as an unbounded 1-dimensional array. Each memory request r specifies a positive integer size , signifying the number of memory slots that must be reserved to satisfy the request.
The allocation algorithm must decide which memory slots to allocate to satisfy a request before seeing the next request. These reserved slots are called the allocation of the request. Each allocation must occupy a contiguous block of memory, and no two allocations can overlap. When a request arrives, it is said to be live. A free specifies a live memory request whose allocation is consequently deallocated, after which the memory slots in the allocation are available for future allocations.
For a memory allocation algorithm A and workload W, the memory high-water mark S(A, W) of algorithm A on workload W is the highest index in the memory array that A allocates on W; and the volume high-water mark, M(W), of W is the maximum number of memory slots ever simultaneously live in W. The (expected) competitive ratio of the algorithm on the workload is defined by
where the expectation is taken over any randomness the algorithm may use. The goal of an allocation algorithm is to achieve as small competitive ratio as possible. In addition to these quantities, it will often also be helpful to refer to the request high-water mark , which is the maximum number of requests that are ever simultaneously live in workload W.
Finally, we will also investigate allocation algorithms that are permitted to use either k-aggregate or k-per-request fragmentation, for some parameter . These algorithms break each request into one or more fragments whose (positive integer) sizes sum to the size of , and then allocate each fragment to some consecutive slots of free memory—these allocations are considered to be live until the request is freed. For a given request broken into some number of fragments, the first of these fragments is said to be a complete fragment, and the others are said to be partial fragments.
In the setting of k-aggregate fragmentation, which is well-defined for any real , the algorithm must ensure, for any workload W that there are never more than fragments alive at a time. When for some , this is equivalent to guaranteeing for every workload W that there are never more than live partial fragments at a time. In the setting of k-per-request fragmentation, which is defined only for positive integer , the algorithm must break each fragment into at most fragments.
In addition to considering algorithms that use k-aggregate fragmentation (resp. k-per-request fragmentation) our lower bounds will also apply to what we call expected-k aggregate fragmentation (resp. expected-k per-request fragmentation), where the algorithm must limit the total number of live fragments at a time (resp. number of fragments per request) to (resp. k) in expectation.
3 Technical Overview
In this section, we present an overview of the technical ideas in the paper, along with how the various techniques and lower bounds fit together. The goal of the section is to arm the reader with the high-level ideas needed to be able to easily understand the full versions of the arguments later in the paper. To streamline the exposition, we will typically focus either on the setting where there is no fragmentation, or on the most basic setting for k-aggregate fragmentation, which is k = 2.
3.1 Warmup: A Tight Lower Bound Without Fragmentation
We begin by discussing how to prove an lower bound for classical (fragmentation-free) memory allocation. In addition to resolving an open question due to Luby, Naor, and Orda [36], the high-level technical approach ends up being essential in all of our other, more general, lower bounds.
Theorem 3.1 (Special case of Theorem 4.1). For any , there exists a workload , with volume high-water mark , that forces any randomized online memory allocation to incur an expected competitive ratio of at least , or equivalently, an expected memory high-water mark of at least .
It is worth taking a moment to contrast our lower bound construction with that of Luby et al. Both of our constructions use an adversarial workload in rounds where jobs increase geometrically in size, with randomized deletions of jobs from prior rounds. Luby et al. prove their lower bound using a sparse witness set on surviving jobs and their consecutive distances, and it is the sparsity of the witness set that contributes the extra log log M factor. Our approach is fundamentally different. We partition memory into aligned diadic blocks and show via a potential function argument that, on average, blocks can receive only a limited total volume of allocations across all rounds of the workload. Thus, we conclude that many memory blocks must be used in order to serve the request sequence. Additionally, while Luby et al. delete items with probability 1/2, our adversarial workload relies on deleting items with a smaller probability to create a larger population of small surviving items, which block larger allocations.
The workload. The workload V that we use for Theorem 3.1 is itself very simple. The workload V consists of rounds , where each round proceeds as follows. In round , the workload V first frees a uniformly random 0.1 fraction of the remaining live requests in each size class; and then makes new requests of size . This is the entire workload.
It is worth noting why V frees requests at the rate that it does. The workload is designed so that, at the end of round r, almost all of the live requests are still from much earlier rounds (there are roughly live requests from round ); but so that almost all of the volume from live requests is due to recent rounds (the volume of requests from round is roughly ).
This volume vs. count dichotomy, in which earlier rounds contribute very little volume but contribute almost all of the live requests, will be essential to our probabilistic analysis. Intuitively, the dichotomy makes it very difficult for the algorithm A to allocate requests in earlier rounds without those requests (many of which will still be present by round ) causing problems for the round- allocations.
High-level approach. Define the round-r blocks in memory, denoted , to be the memory-aligned blocks of size in the memory array (i.e., the disjoint blocks of size whose starting location is a multiple of ). We may assume (WLOG) that, when a size- request is made, it is allocated to a block in (i.e., allocations are power-of-two memory-aligned).
For a given round and a block , define to be the indicator random variable for whether a size- request is ever allocated in that block (it counts even if the request is later deallocated).
Define if and
if , where and are the two level- blocks contained in . In other words, is the total volume of allocations made into in all rounds up to .
The total amount of volume ever allocated (in any block at any time) is given by
Imagine that we could show that all blocks satisfied . This is to say that each block is only able to serve a total volume of requests roughly proportional to . Then, since the total volume of all requests is , we could conclude that the number of blocks that receive at least one allocation must be quite large, at least . Since each such block has size , this would imply a memory high-water mark of , as desired.
Rather than trying to directly show that all blocks satisfy (or ), we will settle for a weaker but nonetheless sufficient claim. Namely, that, for some large constant ,
One can think of (5) as saying that (in expectation) a constant fraction of all volume ever allocated is allocated to a block that, at that point in time, had received less than total volume of allocations.
Moreover, rather than analyze the quantity in (5) directly, we instead analyze a quantity defined as follows. For each round , and for each block , define
where as above, and are the two level- blocks contained in (or where is evaluated as 0, if ). Also define the rounding difference for block to be the difference . Note that this rounding difference can only be non-zero if , and is guaranteed to be at most .
To prove (5), it suffices to show that
But notice that, in general,
Since the first sum is exactly , the task of proving (6) is equivalent to showing that
Thus, the entire lower bound actually comes down to the task of upper bounding the sum of the rounding differences . This sum is trivially at most , and in order for our bound to be useful, we just need to achieve (any) bound that is a constant factor smaller than this. If we can prove such a bound, then we will have a proof of Theorem 3.1.
As we will see, the task of bounding (sums of) rounding differences is amenable to a remarkably clean charging argument. This argument is also the part of the proof that exploits the “volume vs. quantity dichotomy” discussed earlier.
Bounding the rounding differences. To upper bound
we perform what is essentially a charging argument. Suppose some round-r block has non-zero rounding difference . Then, the total amount of volume allocated to in the first rounds (including volume freed) must be at least . Writing , we have that there must be some round that contributed at least
allocations of size to . In order for to be non-zero, there must be a size- allocation that is made to in round . But such an allocation is only possible if all of the earlier round- allocations to were freed during rounds . In this case, we say that charges its rounding difference, which is at most , to round .
For a given pair of rounds and , define to be the set of blocks with the property that received at least allocations in round , and all of those allocations were freed in rounds . The set contains (among other blocks) all round- blocks that charge their rounding difference to round . To upper bound (8), it suffices instead to bound
Here is where we finally benefit from the “volume vs. quantity dichotomy” discussed earlier. Fix some and , and consider a block that receives at least allocations in round . The expected number of those requests that remain live by the end of round is , which is still quite large! By a Chernoff bound (for negatively associated random variables), we can conclude that
On the other hand, the total number of blocks that receive allocations in round is itself, at most . Combining this with (11) allows us to deduce that
Here is where the magnitude of the constant c, used in the definition of comes into play. If c is chosen large enough, then we can replace the asymptotic notation in (12) with an explicit bound of, say,
Plugging this into (10) and simplifying, we can conclude that (10) has expected value at most, say, . This implies the same bound for the sum (8) of the rounding differences, which implies the entire chain of (7), (6), and (5). Having concluded (5), we can then complete the proof of Theorem 3.1.
3.2 Memory Allocation with Request Fragmentation
Next we discuss the more difficult task of proving lower bounds for algorithms that are permitted to perform (various types of) request fragmentation.
Extending to per-request fragmentation. We begin by extending our techniques in the previous section to prove the following theorem:
Theorem 3.2 (Later restated as Theorem 4.1). Consider , let , and let be a randomized memory allocation algorithm using -expected per-request fragmentation. Then there exists a workload that has at most live requests at a time, each with a size in ; that has volume high-water mark ; and that forces to incur a competitive ratio of .
In addition to being a statement about per-request fragmentation, Theorem 3.2 also ends up serving as the main subroutine in our final lower bound (for k-aggregate fragmented algorithms) which we discuss in a moment.
The proof of Theorem 3.2 is the most intricate argument in the paper. It consists roughly of two pieces: (1) a series of reductions, simplifying (in a WLOG fashion) the types of behavior that A might exhibit; and (2) an extension of the argument from the previous section to apply to algorithms that perform fragmentation. The reductions are deferred to Section B and the full details of the proof are shown in Section 4.
Lower bounds for k-aggregate fragmentation. Finally, we can now discuss how to prove a bound of on the competitive ratio of any memory-allocation algorithm using k-aggregate fragmentation on workloads with volume high-water mark bounded above by .
Theorem 3.3 (Special case of Theorem 5.1). Let and and let be a randomized online memory-allocation algorithm that performs -aggregate request fragmentation. Then, there exists a workload with volume high-water mark on which incurs a competitive ratio of at least .
To describe the proof of Theorem 3.3 as simply as possible, let us assume that . Then the workload used to prove Theorem 3.3 can be described as follows. Let . The workload consists of rounds , where each round is implemented as follows:
-
Begin to perform the workload given by Theorem 3.2.
-
Call a request heavily fragmented if the expected number of fragments that breaks into is greater than .
-
If there exists a heavily fragmented request , then end the workload after is requested, and free all live requests in except for .
-
If there does not exist a heavily fragmented request , then complete the workload and terminate the construction. (Do not proceed to phase .)
Notice that the description of the workload W depends, in part, on the algorithm A being used. It does not, however, require us to know anything about the random bits used by A. Critically, we
The proof described here differs slightly from the proof of Theorem 5.1 in how the parameters are set up. Specifically, Theorem 5.1 imposes both upper and lower bounds and on the volume high-water mark, and makes the (WLOG) assumption that . With this slightly more complicated setup, one can replace Q as described here directly with , as in the proof of Theorem 5.1.
can determine in each phase whether there exists a heavily fragmented request based only on the specification of , because the question of whether is heavily fragmented depends only on the expected number of fragments that is broken into, rather than the number that is actually realized.
One way for W to terminate is if we reach a phase r in which there is no heavily fragmented request. In this case, we know by Theorem 3.2 that A incurs an expected memory-high water mark of at least
On the other hand, the volume high-water mark is at most
It follows, in this case, that incurs a competitive ratio of at least .
The other way for to terminate is after all phases complete. In this case, we are left with live requests , each of which is broken into more than expected fragments. The total expected number of fragments is therefore greater than .
On the other hand, the total number of requests that are ever simultaneously live in W is at most
where the term considers the requests , and where the term considers the live requests within a given workload during a given phase . Because guarantees at most -aggregate request fragmentation, it follows that the expected number of fragments can be at most , a contradiction.
In Section 5, we also show the following simple corollary, which extends the above lower bounds to the -aggregate fragmentation regime for .
Corollary 3.4. Let and . Let be a randomized online memory-allocation algorithm that performs -aggregate request fragmentation. Then, there exists a workload with volume high-water mark on which incurs a competitive ratio of at least .
Understanding why the lower bound produces . At this point, it is worth taking a moment to think about the structure of the above construction, in order to understand why is the bound that naturally comes out.
The first question to consider is why we must require each round to use , as opposed to using for every round. This is so that (14) holds—that is, so that, if the algorithm terminates in some phase , its volume high-water mark is dominated by the volume high-water mark of . This requirement may seem minor, but it is the reason that we must cap the number of phases to .
The next question to consider is why we must set to be so small, and, in particular, why . The main bottleneck to making large is that, in each phase , the number of simultaneously live requests may be up to . But, at the end of the construction, we have requests that are each broken into more than expected fragments. In order for this to lead to a contradiction (i.e., we have too many fragments), we need .
When we put these two constraints together, we get that and . The competitive ratio that we recover is given by the performance of Theorem 3.2 on a workload of the form , which results in a competitive ratio of . This is where the bound of ultimately comes from.
A matching upper bound. A priori, the above lower bound may seem quite loose. Nonetheless, there is also a remarkably simple algorithm that achieves a matching upper bound. In Section 6, we prove the following.
Theorem 3.5 (Special case of Theorem 6.3). For and , there is a (deterministic) online allocation algorithm using k-aggregate fragmentation that achieves competitive ratio on every workload W with volume high-water mark .
The entire algorithm (again, for the case of ) is as follows. At all times , keep track of both the volume high-water mark and the request high-water mark so far. Then, when processing a request of size , break it into
fragments of size at most each, where is some appropriately chosen positive constant. Finally, allocate each of these fragments using a first-fit policy, placing the fragment in the free region of memory large enough to host the fragment.
Although the description of the above algorithm is quite simple, the analysis is perhaps surprisingly subtle, and is deferred to Section 6. In that section, we also generalize this algorithm to the -aggregate fragmentation regime for , resulting the following upper bound matching our lower bound.
Theorem 3.6 (Special case of Theorem 6.4). For and , there is a (deterministic) online allocation algorithm using -aggregate fragmentation that achieves competitive ratio on every workload such that .
4 A Tight Lower Bound for Expected-k Per-Request Fragmentation
In this section, we prove the following theorem:
Theorem 4.1. For any and , there exists a randomized workload with volume high-water mark and , such that for any (possibly randomized) allocation algorithm with -expected per-request fragmentation, the competitive ratio of on satisfies
We immediately get the following corollaries. First, setting Q = M yields the following lower bound for the competitive ratio in terms of M.
Corollary 4.2. Given and a (possibly randomized) allocation algorithm with -expected per-request fragmentation, there exists a workload with volume high-water mark such that
Interestingly, although the algorithm in Section 6 is quite simple, it was not at all obvious to the current authors until after the lower bound was discovered. The algorithm was then obtained by trying to design an algorithm for which the lower bound would be tight.
The reader may notice that the above algorithm description is in a few (it turns out, purely aesthetic) ways slightly different from the one in Section 6. These differences, and specifically the distinction between having implicit phases (as in this algorithm) versus explicit phases (as in Section 6) is only to streamline the exposition in Section 6 (allowing us, in particular, to prove Theorem 6.3 using Theorem 6.1 directly as a subroutine).
It should be noted that Corollary 4.2 is tight, as can be seen with the following simple argument.
Theorem 4.3. For any , there exists a deterministic allocation algorithm using k-per-request fragmentation that, on any workload W, achieves competitive ratio
Proof. For , this follows from the classical upper bound for the first-fit algorithm [41,42]. For , we can use -per-request fragmentation to break each request into fragments whose sizes are within an factor of a power of . Up to constant factors, we may therefore assume that each fragment has a size exactly equal to a power of . This reduces the number of distinct allocation sizes to at most . The claimed result then follows from the fact that, on any workload with distinct object sizes, the first-fit allocation algorithm achieves competitive ratio [36].
The second corollary of Theorem 4.1 is for the case where . Here, we prove a conjecture of [36], showing that randomized allocation algorithms cannot (in an asymptotic sense) beat deterministic ones:
Corollary 4.4. Let . If is a (possibly randomized) algorithm which does not fragment allocations, then there exist workloads W with volume high-water mark such that
Reducing Theorem 4.1 to Theorem 4.5. The first step of the proof, which we defer to Section B is the following. We show that to prove Theorem 4.1, it is sufficient to prove an alternative theorem that applies to algorithms that use what we call -selective (=k)-aligned-even-fragmentation.
In what follows, and throughout the rest of the section, we will assume without loss of generality that satisfies is a power of 2 and that are powers of . Moreover, we will only discuss workloads in which the requests are also power-of-two sizes.
With this in mind, we define a -aligned-even-fragmentation algorithm to be one that fragments each request into exactly fragments, each of which is allocated a sequence of slots of the form for some non-negative integer . On top of this, a -selective algorithm is allowed to ignore each request (not necessarily independently!) with probability (up to) . Requests ignored this way do not count against its memory high-water mark.
Section B shows that, to prove Theorem 4.1, it suffices to prove the following.
Theorem 4.5. Let be a power of two, and let M and Q be powers of k. If A is a 1/4-selective (=k)-aligned-even-fragmentation allocation, then there exists a workload W (whose requests all have power-of-two sizes) with and such that
The rest of the section is dedicated to proving Theorem 4.5. Throughout, we will assume without loss of generality that the parameters k, M, Q are all powers of 2.
In the rest of this section, we will prove Theorem 4.5. We start by defining an adversarial workload and analyzing its properties. Then we analyze the memory usage of an allocator (satisfying the conditions of Theorem 4.5) against the workload.
Note that rounding k up to a power of 2 greater than 1, and rounding M and Q down to powers of k only makes the lower bound harder to prove, because it does not change the asymptotic lower bound that we wish to achieve.
4.1 The Adversarial Workload
The proof of Theorem 4.5 makes use of the following workload with volume high-water mark and request high-water mark .
The workload V proceeds in rounds , where in each round , all of the requests that are made have the same size
Since the allocation algorithm breaks each request into exactly k fragments, it follows that each round-r fragment has size
Note that both and are, by assumption, powers of . To assist with the discussion of the rounds, we will also use to denote the set of all round- requests that remain live after round .
With this notation in place, the structure of each round r is as follows:
- First, the workload frees a uniformly random 0.1 fraction of each existing request class , for (these become ).
• Then, the workload makes requests of size as the next request class .
Note that V's randomization affects only which requests it frees in each round.
Before continuing into the analysis, we take a moment to remark on some basic properties that the above workload has. First, notice that the volume of requests made in each round is deterministically M. As a consequence, we have:
Lemma 4.6. The total mass of requests A ever made by V is .
Also notice that, by design, we have the desired bounds on and .
Lemma 4.7. The volume high-water mark of V is and the request high-water mark is .
Proof. At the end of a given round r, the volume of live requests is at most
implying a volume high-water mark of . The request high-water mark occurs after the first round, when Q requests have been made.
Finally, in the proof of Theorem 4.5, we will make use of the following basic bound on the probability that a given set of requests have all been freed.
Lemma 4.8. Let be requests made in round , and let be the event that every has been freed by round . Then
Proof. Let be the random variable indicating that request has been freed by round . Since the round- requests freed in rounds are a random subset of the round- requests, we know that are negatively associated (see, e.g., [24,51]), which implies that
where the final step uses the identity .
4.1.1 Proof of Theorem 4.5
Having constructed the workload V, we turn to proving Theorem 4.5.
Define the round-r blocks, denoted , to be the memory-aligned blocks of size in the memory array We refer to these as round-r blocks because in round of the workload, an -aligned-even-fragmentation algorithm must allocate fragments precisely into these blocks.
A round-r block consists of round- blocks, round- blocks and so on. Notice that if the algorithm allocates a fragment into a round-r block in round , it entirely consumes the block, so there can have been no live fragments present. Thus, if there were allocations made to any of its constituent round-t blocks (for ) in prior rounds, these must have been deallocated already.
A key insight behind the following analysis is that if the component round-t blocks of a round-r block were allocated efficiently, i.e., were packed with fragments, then the probability that all of these round-t fragments have since been deallocated is very small. Thus the algorithm loses either way: either it uses its space inefficiently up front, or it cannot reuse blocks as deallocations make them sparser. At a high level, the proof shows the algorithm must allocate a constant fraction of the total allocated volume (excluding deallocations) in new space, which yields the lower bound.
More concretely, for a given round-r block B, let be the indicator random variable for whether a -size fragment is ever allocated in that block (it counts even if the fragment is later deallocated). Note that if a selective algorithm ignores a request, then this request will not contribute to any values.
Let be a parameter that we will later set to be a large positive constant. For each round , and for each round- block define and as follows. If , then . If , then
where are the k level- blocks that comprise ; and define
For each block , define . The following lemma will be useful later.
Lemma 4.9. For all rounds and blocks , .
Proof. Each for the blocks comprising . Thus
and so .
Before continuing, let us briefly discuss some intuition about how we will proceed. Intuitively, for a round-r block , we will want a quantity like to be a measure of how efficiently the algorithm has used the space in in the rounds up to and including . Define if and
if . Equivalently, is the total volume of allocations made into in all rounds up to . If we could show that were bounded by for all and and some constant , this would say that the total volume of allocations into over time is a constant multiple of its size. But since the total volume of all requests in the first rounds is , this would imply that the algorithm must use many round- blocks, thereby incurring a large memory high-water mark.
Rather than trying to directly prove that (or ) is at most , for each round-r block , we will instead focus on the closely related functions and defined above. These functions are defined in such a way that, when , we can charge the “overflow” to the component sub-blocks of . In particular, when exceeds , we want this to be charged to and then not recharged to the superblocks of . captures this charge.
The following two lemmas capture this intuition more formally. The first captures the idea that, to lower-bound , it suffices to lower-bound .
Lemma 4.10. Let A be a 1/4-selective (= k)-aligned-even-fragmentation algorithm. Then on workload V,
Proof. Let be the blocks that are used by the algorithm in at least one round. By design, for all , and for each . Thus
The factor of 2 in the last inequality comes from the fact that the last block can potentially be almost entirely over the memory high-water mark; the largest block size is , so this consideration contributes at most a factor of 2.
Therefore, if we can lower bound , this provides a lower bound on the memory high-water mark as well. Recall that 1/4-selective algorithms may probabilistically ignore some allocations. Let be the random variable denoting the total volume of the allocations that are not ignored by on . (Note that , by definition.) The following lemma captures the idea that we can use the 's to evaluate the difference between and .
Lemma 4.11. let A be a 1/4-selective (= k)-aligned-even-fragmentation algorithm. Then on workload V,
Proof. Let be the total volume of unignored requests in round r. We proceed by induction on r. For round 1, we have
Assume that
For a round-r block B, is the sum of on its round- subblocks together with the volume any new allocation made to B during the round. In round r, total allocations are made, so
which completes the induction. The result now follows since .
Taking expected values, we can deduce:
Corollary 4.12. Let A be a 1/4-selective (= k)-aligned-even-fragmentation algorithm. Then on workload V,
Proof. Since is 1/4-selective, for any workload with request volume , the allocated volume must satisfy . The lemma follows by taking expectations in Lemma 4.11, and Lemma 4.6.
We remark that the 1/4-selectiveness of A comes into play in the above lemma, when taking E[A]. It turns out that this will be the only point in the proof where the 1/4-selectiveness ends up mattering in any substantive way.
At this point, we have established a chain of connections, reducing the task of proving Theorem 4.5 to the task of bounding the sum of the to be at most, say, RM/4. This is what we do in the following lemma, which is the main technical lemma of the section:
Lemma 4.13. If we set c to be a sufficiently large positive constant, then
Proof. Consider a round-t block with . Then by definition, , and in particular, the sum of all allocations made within (including those since deallocated) is at least . Since at most volume can be allocated in in round , this means that at least volume must have been allocated in in prior rounds. Let . Then
so there must be some round such that the number of fragments allocated in in round is at least . Let be the largest such (i.e. the most recent round in which this occurred), and “charge” to the pair .
For each pair define to be the total amount charged to that pair by all round- blocks. By construction,
so we will focus the rest of the proof on bounding the expectation of the latter sum.
Let be the set of blocks with the property that received at least fragments from round- requests. Note that since allocates at most fragments in round ,
Any block that charges value to must be in . Furthermore, in order for a block to charge value to , all of the size- fragments in must get deallocated by the end of round . These fragments come from at least unique requests, since each request gets exactly fragments. Let be the number of live round- requests in at the end of round .
By Lemma 4.8 the probability that all these requests are freed by round is
Combining (15) and (16), the expected number of blocks in that charge anything to is at most
If a block does charge to , then since by Lemma 4.9, the charge can be at most . Thus,
Because , for large enough . Therefore, for large enough (and therefore large enough), this implies
Finally, summing over all pairs , we get
18
☐
Proof of Theorem 4.5. By Lemma 4.10,
which by Corollary 4.12 is at least
By Lemmas 4.7 and 4.13, this has expected value at least
This completes the proof of the theorem.
5 Lower Bounds for Aggregate Fragmentation
In this section, we develop (what will turn out to be) tight lower bounds for algorithms using k-aggregate fragmentation. As we will see, these lower bounds depend heavily on the machinery already developed in Section 4.
We begin with the following bound, which is tight for .
Theorem 5.1. For any k-expected-aggregate fragmentation algorithm A with k > 1, and such that , there exists W with for which
Proof. We may assume WLOG that . We may also assume WLOG that since increasing so that does not asymptotically change the quantity , and therefore does not asymptotically change the guarantees of the theorem.
Let . Let be an algorithm with for all workloads with . We will show that there exists a workload , with , with some request high-water mark at the end of which has more than (expected) fragments that are simultaneously live, therefore contradicting the fact that uses -expected aggregate fragmentation. Throughout the proof, we will use for a request to denote the number of fragments that the algorithm breaks into.
We iteratively use Theorem 4.1 in rounds to build the desired workload . Set and for . By Theorem 4.1, there exists a workload with and such that any algorithm with must have some request with . In round of the workload , we run until we perform a request satisfying (we will argue shortly that such a request must occur). When is requested, we stop running and we free all other requests from , ending the round.
To analyze the workload , we must first argue that each exists. To see this, observe that the volume high-water mark from rounds 1 to is at most . Therefore, by assumption, has memory high-water mark . It follows by the definition of that there does, in fact, exist some request in round satisfying .
Having proven that the requests exist, we can now obtain a contradiction as follows. At the end of round , the live requests are (we call these the retained requests). Recalling that each has request high-water mark (by construction), the overall request high-water mark is at most (accounting both for the high-water mark of a given , plus the up to retained requests that may also be live). Each retained request has , so the fragment high-water mark at the end of round is more than in expectation. This contradicts the fact that uses expected- aggregate fragmentation.
In the case where for some , we can prove a separate lower bound of on the competitive ratio.
Lemma 5.2. Consider parameters and satisfying . Let denote the set of workloads with volume high-water mark . Any (randomized) online algorithm using -expected aggregate fragmentation must incur a competitive ratio of on some workload .
Proof. Note that the algorithm can, in expectation, create at most partial fragmentations on any workload with . On such a workload, the algorithm is an -expected per-request fragmentation algorithm. The claimed result therefore follows from Theorem 4.1.
We can now prove Corollary 3.4. Together, Theorem 5.1 and Corollary 3.4 imply that all of our upper bounds in Section 6 are tight.
Corollary 3.4. Let and . Let be a randomized online memory-allocation algorithm that performs -aggregate request fragmentation. Then, there exists a workload with volume high-water mark on which incurs a competitive ratio of at least .
Proof. The corollary follows by combining Lemma 5.2 and Theorem 5.1, noting that Theorem 5.1 immediately applies to the regime where (since this gives a stronger condition on the algorithm than ).
6 Upper Bounds for Aggregate Fragmentation
In this section, we construct optimal allocation algorithms using k-aggregate fragmented allocation. All of the bounds in this section are asymptotically tight by Theorem 5.1 and Corollary 3.4.
We begin with the setting where is known, and where for some . The algorithm that we construct in this setting (which comes with a surprisingly subtle analysis) ends up serving as the main building block for all of the other algorithms that we construct later on.
Theorem 6.1 ((1 + ε)-Aggregate-Fragmented Allocation with Known M). Consider parameters , , and . Let denote the set of workloads with volume high-water mark , and where every allocation has a power-of-q size. There is a (deterministic) online allocation algorithm , using -aggregate fragmentation, that achieves competitive ratio on every workload .
Proof. The algorithm keeps track, at all times , of the maximum number of requests that are ever live simultaneously at or prior to time . If, at time , a request of size is made, then the algorithm considers two cases:
-
If , then the request is kept as a single fragment.
-
If , then the request is broken into fragments of size at most .
Each fragment is then allocated according to the first-fit algorithm, which places the fragment in the earliest free region in memory whose size is large enough for the fragment.
To simplify exposition for how we discuss fragments, define the effective size of each fragment created at time to be if the fragment is created by Case 1, and to be if the fragment is created by Case 2. Note that the sum of the effective sizes of all live fragments is at most .
Before analyzing the memory high-water mark, let us take a moment to verify that the algorithm uses at most aggregate-fragmentation. Let Q be the largest number of requests that are ever simultaneously live. By design, the algorithm breaks each request of a given size s into at most
fragments. Summing over the set L of live requests at any given moment, the total number of fragments is at most
Since there are non-partial fragments, the number of partial fragments is at most , as desired.
In the rest of the proof, we bound the competitive ratio achieved by the algorithm. For and time , define to be the largest power of smaller than . Say that a fragment is type- if, at the time when was allocated, was the smallest such . Notably, if has size at most , then its type will be 0. Additionally, break memory into segments, where each segment has size .
To analyze this algorithm, we establish the following type-segmentation invariant: Every type-j fragment is placed somewhere in the first segments of memory. Note that this invariant is enough to complete the proof—since every fragment has type at most , it follows that the memory-high water mark is at most .
We emphasize that, in the above invariant, the type j associated with a fragment f is partially a function of when f was inserted. (If the same fragment f were inserted earlier/later, it might have a completely different type.) Given this, it may seem odd that one can state an invariant that treats all objects of a given type in the same way – nonetheless, we will see that the invariant holds.
We prove the type-segmentation invariant by strong induction on t. Suppose that the invariant holds for all prior allocations, and consider a fragment f allocated at time t.
The first case to consider is if has type 0. Suppose for contradiction that does not get allocated in the first segment. Let denote the set of fragments that are allocated in the first segment. Since did not get allocated in the first segment, the segment does not contain any free interval of size . But this means that the total size of the first segment is less than
To evaluate this summation, we will calculate an upper bound on the number of fragments in the first segment. By the definition of the algorithm and since can only increase over time, the number of fragments of size less than is at most . Thus, the number of fragments in the first segment is . This means that the size of the first segment is less than . But we also know that the first segment has size exactly 4M, so we get a contradiction.
The second case to consider is if has type for some . In this case, we claim that all of the fragments currently in segment have effective sizes satisfying . By the invariant, such a fragment must have some type . Let be the time at which was inserted. Here there are two cases: if is a power of , then it must be that , meaning that ; in this case, since , we get that , as desired. The other case is that ; but, since is allocated at time , its size is at most , so once again we have . Thus every currently in segment has effective size .
Now, suppose for contradiction that does not get placed in the first segments. Then, in segment , every free interval has size at most . If we define to be the set of fragments in the segment, then it follows that the segment has size at most
Since for each , this is less than
Since , , and , it follows that the size of the -th segment is less than 4M, which once again is a contradiction.
Theorem 6.1 assumes that every request has a power-of-q size. Notice, however, that for q = 2, this assumption is WLOG (up to a factor-of-two change to M). Thus we get the following corollary, which does not make any assumptions on the sizes of requests.
Corollary 6.2. Consider parameters and . Let denote the set of workloads with volume high-water mark . There is a (deterministic) online allocation algorithm , using -aggregate fragmentation, that achieves competitive ratio on every workload .
Next, we turn our attention to the setting where is not known (or is only partially known) a priori. Here, we consider two parameter regimes for , the large regime of (Theorem 6.3) and the small regime of (Theorem 6.4). As noted earlier, in each case, the competitive ratios that we obtain are optimal (by Theorem 5.1 and Corollary 3.4).
Theorem 6.3 (k-Aggregate Fragmented Allocation with Unknown M). Consider parameters and . There is a (deterministic) online allocation algorithm using k-aggregate fragmentation that achieves competitive ratio on every W satisfying .
Proof. Note that we can use 0.1k-aggregate fragmentation to break requests into fragments whose sizes are each within a constant factor of a power of k. Thus, rather than using k-aggregate fragmentation with arbitrarily-sized requests, we may assume without loss of generality that we are using 0.9k-aggregate fragmentation and that every request size is a power of k. We will include this assumption throughout the rest of the proof. We will also assume without loss of generality that is a power of 2.
In fact, obtaining this assumption is the only part of the proof in which we require k-aggregate fragmentation as opposed to, say, 1.8-aggregate fragmentation.
With these assumptions in place, we define the algorithm as follows. At all times , keep track of a quantity , defined to be if the volume high-water mark up to time is at most , and defined otherwise to be the volume high-water mark up to time . Whenever reaches (or crosses) a power of two , for some , we enter what we call . During phase , we process requests using the algorithm (as defined in Theorem 6.1). If, prior to phase , the memory high-water mark for was given by some quantity , then during phase the algorithm uses the region of memory starting immediately after .
By Theorem 6.1, with , the growth in memory high-water mark during phase is at most
Summing over gives a total memory high-water mark of
as desired.
Now, let us turn to bounding the total number of partial fragments. Let (resp. ) be the maximum number of simultaneously live requests that are allocated by (resp. by the entire algorithm). Then, by Theorem 6.1, the total number of partial fragments that are ever simultaneously live in is at most
The total number of partial fragments that are simultaneously live across the entire algorithm is therefore at most
as desired.
Theorem 6.4 ((1 + ε)-Aggregate Fragmented Allocation with Unknown M). Consider parameters and . There is a (deterministic) online allocation algorithm , using -aggregate fragmentation that achieves competitive ratio on every workload satisfying .
Proof. We assume without loss of generality that every request has a power-of-two size. We then define the algorithm as follows. At all times , keep track of a quantity , defined to be if the volume high-water mark up to time is at most , and defined otherwise to be the volume high-water mark up to time . Whenever reaches (or crosses) a power of two , for some , we enter what we call . During phase , we process requests using the algorithm (as defined in Theorem 6.1). If, prior to phase , the memory high-water mark for was given by some quantity , then during phase the algorithm uses the region of memory starting immediately after .
By Theorem 6.1, with , the growth in memory high-water mark during phase is at most
Summing over gives a total memory high-water mark of
as desired.
Finally, we bound the total number of partial fragments. Let (resp. ) be the maximum number of simultaneously live requests that are allocated by (resp. by the entire algorithm). Then, by Theorem 6.1, the total number of partial fragment that are ever simultaneously live in is at most
Thus the total number of partial fragments that are simultaneously live across the entire algorithm is at most
as desired.
Acknowledgements
This work was supported by NSF grants CNS-2504470, CCF-2106999, CCF-2118620, CCF-2118832, CCF-2106827, and CCF-2247577. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.
Michael Bender was supported in part by the John L. Hennessy Chaired Professorship and Sandia National Laboratories. Martin Farach-Colton was supported in part by the Leonard J. Shustek professorship. Hanna Komlós was supported in part by the Graduate Fellowships for STEM Diversity. This work was done in part while Hanna Komlós was visiting the Simons Institute for the Theory of Computing, and was supported in part by Google Research, Fall 2025. William Kuszmaul was supported in part by a grant from Jane Street. Nicole Wein is supported by NSF CAREER award 2541910. This work was initiated while Nicole Wein was at DIMACS, Rutgers University, supported by a grant to DIMACS from the Simons Foundation (820931), and continued while visiting the Simons Institute.
References
[1] Communications of the ACM, volume 4, number 10 (october 1961). Communications of the ACM, vol. 4, no. 10, October 1961. Entire issue.
[2] Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau. Operating Systems: Three Easy Pieces. CreateSpace Independent Publishing Platform, 2018. Print edition; widely known as OSTEP.
[3] Brenda S. Baker and Edward G. Coffman Jr. A two-dimensional bin-packing model of preemptive, FIFO storage allocation. J. Algorithms, 3(4):303–316, 1982.
[4] Michael A. Bender, Martin Farach-Colton, Sándor P. Fekete, Jeremy T. Fineman, and Seth Gilbert. Reallocation problems in scheduling. In Proc. 25th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 271–279, 2013.
[5] Michael A. Bender, Martin Farach-Colton, Sándor P. Fekete, Jeremy T. Fineman, and Seth Gilbert. Cost-oblivious storage reallocation. In Richard Hull and Martin Grohe, editors, Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS'14, Snowbird, UT, USA, June 22-27, 2014, pages 278–288. ACM, 2014.
[6] Michael A Bender, Martín Farach-Colton, Sándor P Fekete, Jeremy T Fineman, and Seth Gilbert. Cost-oblivious reallocation for scheduling and planning. In Proceedings of the 27th ACM symposium on Parallelism in Algorithms and Architectures, pages 143–154, 2015.
[7] Adam L. Buchsbaum, Howard Karloff, Claire Kenyon, Nick Reingold, and Mikkel Thorup. OPT versus LOAD in dynamic storage allocation. SIAM J. Comput., 33(3):632–646, 2004.
[8] Marek Chrobak and Maciej Slusarek. On some packing problem related to dynamic storage allocation. RAIRO Theor. Informatics Appl., 22(4):487–499, 1988.
[9] Marek Chrobak and Maciej Slusarek. On some packing problem related to dynamic storage allocation. RAIRO Theor. Informatics Appl., 22(4):487–499, 1988.
[10] E. G. Coffman, Jr. and F. T. Leighton. A provably efficient algorithm for dynamic storage allocation. volume 38, pages 2–35. 1989. 18th Annual ACM Symposium on Theory of Computing (Berkeley, CA, 1986).
[11] Edward G. Coffman, Jr., M. R. Garey, and D. S. Johnson. Approximation algorithms for np-hard problems. chapter Approximation Algorithms for Bin Packing: A Survey, pages 46–93. PWS Publishing Co., 1997.
[12] Edward G. Coffman, Jr., M. R. Garey, and David S. Johnson. Dynamic bin packing. SIAM J. Comput., 12(2):227–258, 1983.
[13] Edward G. Coffman, Jr., David S. Johnson, Peter W. Shor, and Richard R. Weber. Markov chains, computer proofs, and average-case analysis of best fit bin packing. In Proc. Twenty-Fifth Annual ACM Symposium on Theory of Computing (STOC), pages 412–421, 1993.
[14] Edward G. Coffman, Jr., David S. Johnson, Peter W. Shor, and Richard R. Weber. Bin packing with discrete item sizes, part ii: Tight bounds on first fit. Random Struct. Algorithms, 10(1-2):69–101, 1997.
[15] George O Collins Jr. Experience in automatic storage allocation. Communications of the ACM, 4(10):436–440, 1961.
[16] Martin Farach-Colton, William Kuszmaul, Nathan S Sheffield, and Alek Westover. A nearly quadratic improvement for memory reallocation. In Proceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures, pages 125–135, 2024.
[17] Amos Fiat, Richard M Karp, Michael Luby, Lyle A McGeoch, Daniel D Sleator, and Neal E Young. Competitive paging algorithms. Journal of Algorithms, 12(4):685–699, 1991.
[18] Gábor Galambos and Gerhard J. Woeginger. On-line bin packing - a restricted survey. Math. Meth. of OR, 42(1):25–45, 1995.
[19] Michael R. Garey and David S. Johnson. Computers and Intractability; A Guide to the Theory of NP-Completeness. W. H. Freeman & Co., USA, 1990.
[20] Jordan Gergov. Approximation algorithms for dynamic storage allocations. In Josep Díaz and Maria J. Serna, editors, Algorithms - ESA '96, Fourth Annual European Symposium, Barcelona, Spain, September 25-27, 1996, Proceedings, volume 1136 of Lecture Notes in Computer Science, pages 52–61. Springer, 1996.
[21] Jordan Gergov. Algorithms for compile-time memory optimization. In Proceedings of the tenth annual ACM-SIAM symposium on Discrete algorithms, pages 907–908, 1999.
[22] Nicholas G. Hall and Chris N. Potts. Rescheduling for new orders. Operations Research, 52(3):440–453, 2004.
[23] Ce Jin. Memory reallocation with polylogarithmic overhead. CoRR, abs/2602.15417, 2026.
[24] Kumar Joag-Dev and Frank Proschan. Negative association of random variables with applications. The Annals of Statistics, pages 286–295, 1983.
[25] Edward G. Coffman Jr., M. R. Garey, and David S. Johnson. Dynamic bin packing. SIAM J. Comput., 12(2):227–258, 1983.
[26] Bala Kalyanasundaram and Kirk Pruhs. Dynamic spectrum allocation: The impotency of duration notification. In Sanjiv Kapoor and Sanjiva Prasad, editors, Foundations of Software Technology and Theoretical Computer Science, 20th Conference, FST TCS 2000 New Delhi, India, December 13-15, 2000, Proceedings, volume 1974 of Lecture Notes in Computer Science, pages 421–428. Springer, 2000.
[27] H. A. Kierstead. The linearity of first-fit coloring of interval graphs. SIAM J. Discrete Math., 1(4):526–530, 1988.
[28] Hal A Kierstead. A polynomial time approximation algorithm for dynamic storage allocation. Discrete Mathematics, 88(2-3):231–237, 1991.
[29] Kenneth C. Knowlton. A fast storage allocator. Commun. ACM, 8(10):623–624, October 1965.
[30] Kenneth C. Knowlton. A programmer's description of l6. Commun. ACM, 9(8):616–625, August 1966.
[31] Donald E. Knuth. The Art of Computer Programming: Fundamental Algorithms, volume 1. Addison-Wesley, third edition, 1997.
[32] William Kuszmaul. Strongly history-independent storage allocation: New upper and lower bounds. In 2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS), pages 1822–1841. IEEE, 2023.
[33] Christos Panagiotis Lamprakos, Sotirios Xydis, Francky Catthoor, and Dimitrios Soudris. The unexpected efficiency of bin packing algorithms for dynamic storage allocation in the wild: An intellectual abstract. In Stephen M. Blackburn and Erez Petrank, editors, Proceedings of the 2023 ACM SIGPLAN International Symposium on Memory Management, ISMM 2023, Orlando, FL, USA, 18 June 2023, pages 58–70. ACM, 2023.
[34] Shuai Cheng Li, Hon Wai Leong, and Steven K. Quek. New approximation algorithms for some dynamic storage allocation problems. In Kyung-Yong Chwa and J. Ian Munro, editors, Computing and Combinatorics, 10th Annual International Conference, COCOON 2004, Jeju Island, Korea, August 17-20, 2004, Proceedings, volume 3106 of Lecture Notes in Computer Science, pages 339–348. Springer, 2004.
[35] Wei Quan Lim, Seth Gilbert, and Wei Zhong Lim. Dynamic reallocation problems in scheduling. arXiv preprint arXiv:1507.01981, 2015.
[36] Michael Luby, Joseph Naor, and Ariel Orda. Tight bounds for dynamic storage allocation. SIAM J. Discret. Math., 9(1):155–166, 1996.
[37] RJ Maher. Problems of storage allocation in a multiprocessor multiprogrammed system. Communications of the ACM, 4(10):421–422, 1961.
[38] Praveen K Murthy and Shuvra S Bhattacharyya. Approximation algorithms and heuristics for the dynamic storage allocation problem. Citeseer, 1999.
[39] Joseph (Seffi) Naor, Ariel Orda, and Yael Petruschka. Dynamic storage allocation with known durations. Discrete Applied Mathematics, 3:203–213, 2000.
[40] N. S. Narayanaswamy. Dynamic storage allocation and on-line colouring interval graphs. In Kyung-Yong Chwa and J. Ian Munro, editors, Computing and Combinatorics, 10th Annual International Conference, COCOON 2004, Jeju Island, Korea, August 17-20, 2004, Proceedings, volume 3106 of Lecture Notes in Computer Science, pages 329–338. Springer, 2004.
[41] J. M. Robson. An estimate of the store size necessary for dynamic storage allocation. J. ACM, 18(3):416–423, July 1971.
[42] J. M. Robson. Worst case fragmentation of first fit and best fit storage allocation strategies. Comput. J., 20(3):242–244, 1977.
[43] John Michael Robson. Bounds for some functions concerning dynamic storage allocation. J. ACM, 21(3):491–499, 1974.
[44] Peter Sanders, Naveen Sivadasan, and Martin Skutella. Online scheduling with bounded migration. Math. Oper. Res., 34(2):481–498, 2009.
[45] Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne. Operating System Concepts, 10th Edition. Wiley, 2018.
[46] Daniel D. Sleator and Robert E. Tarjan. Amortized efficiency of list update and paging rules. Communications of the ACM, 28(2):202–208, February 1985.
[47] Maciej Slusarek. Np-completeness of storage allocation. Jagiellonian University Scientific Papers, Computer Science Series, 3:7–18, 1987.
[48] Maciej Slusarek. A coloring algorithm for interval graphs. In Antoni Kreczmar and Grazyna Mirkowska, editors, Mathematical Foundations of Computer Science 1989, MFCS'89, Porabka-Kozubnik, Poland, August 28 - September 1, 1989, Proceedings, volume 379 of Lecture Notes in Computer Science, pages 471–480. Springer, 1989.
[49] William Stallings. Operating Systems - Internals and Design Principles (7th ed.). Pitman, 2011.
[50] Ali Tamer Unal, Reha Uzsoy, and Ali S. Kiran. Rescheduling on a single machine with part-type dependent setup times and deadlines. Annals of Operations Research, 70(0):93–113, 1997.
[51] David Wajc. Negative association: definition, properties, and applications. Manuscript, available from https://goo.gl/j2ekqM, 7, 2017.
[52] D. R. Woodall. The Bay Restaurant—a linear storage problem. Amer. Math. Monthly, 81:240–246, 1974.
A Generalizing to Average Fragmentation
In this section, we consider two natural notions of average fragmentation as relaxations of per-request fragmentation. We provide reductions showing that they have equivalent bounds to per-request fragmentation. The idea of the reductions is to define workloads that “artificially” inflate these measurements of average fragmentation.
Define memory-average fragmentation as the high-water mark of the number of live fragments divided by the number of live requests. Our goal is to prove the following lemma:
Claim A.1. Any algorithm A with expected memory-average fragmentation also must have expected per-request fragmentation .
Proof. Suppose for contradiction that there is a workload W such that under algorithm A there exists a request q with expected > k fragments. We will show that there is another workload under which A incurs expected memory-average fragmentation > k. Define to be the same as W until right after q. (Note that the oblivious adversary constructing knows the identity of q by knowing the distribution of A.) Then, frees all other requests except q. Now, the expected memory-average fragmentation is > k, a contradiction.
Define cumulative-average fragmentation as the total number of fragments ever created divided by the total number of requests ever allocated. Our goal is to prove the following lemma:
Claim A.2. If there is a workload on which any algorithm with expected per-request fragmentation has expected memory high-water mark S, then there is a workload for which any algorithm with expected cumulative-average fragmentation also has expected memory high-water mark S.
Proof. Let be an algorithm with cumulative-average fragmentation . In particular, has the property that for any workload and any request , if the workload were to stop at any point and repeatedly request and frees , then after a finite number of requests/frees, would have expected number of fragments . (Otherwise, such a workload with an indefinite number of repeated requests/frees of would have expected cumulative-average fragmentation .)
Given the algorithm , let workload be identical to , except whenever incurs > k expected fragmentation of a request q, repeatedly requests/frees q until the expected fragmentation of q is , and then continues with workload as usual. (Note that the oblivious adversary constructing knows the identity of q by knowing the distribution of .)
Let be an algorithm identical to , except if is ever about to service a request with > fragments, instead it pretends that the workload repeatedly requests and frees , simulating until has fragments, and requests with its final division into fragments. We know that will eventually break into fragments by the previous paragraph. Observe that has per-request fragmentation .
By construction, on , and on have the same expected memory high-water mark. By assumption, running on has expected memory high-water mark S, so running on also has expected memory high-water mark S. The claim follows since was chosen to be an arbitrary algorithm with cumulative-average fragmentation .
B Reducing Theorem 4.1 to Theorem 4.5
In this section, we prove that Theorem 4.1 follows from Theorem 4.5.
In what follows we will always assume (WLOG) that , that is a power of two, and that and are powers of . These assumptions are WLOG in that, even if we round up to a power of 2 (greater than 1) and round and down to powers of , the asymptotic lower bound that we wish to prove does not change.
We now prove a series of reductions between different classes of algorithms. In what follows, recall that an algorithm is -selective if it is permitted to ignore each request with probability up to .
Lemma B.1. Let A be an algorithm that breaks each request into fragments, in expectation. Then there exists a 1/4-selective algorithm B that breaks each request into at most 4k fragments (deterministically!) and such that for all workloads W.
Proof. We simulate A and use its output to create B. Whenever A allocates a request with at most 4k fragments, B performs the same allocation. Otherwise, B ignores the request, which by Markov's Inequality can happen at most 1/4 of the time.
Lemma B.2. Let A be a 1/4-selective algorithm that breaks each request into at most k pieces. Then there exists a 1/4-selective algorithm B that breaks each request into k equal-sized fragments, and such that for all workloads W, , where 4W refers to the workload which allocates requests of exactly 4 times the size of those in W.
Proof. We will simulate A and use its output to create B.
To allocate a request of size in , we simulate an request of size in . If ignores the requests, then does too. Otherwise, suppose that breaks into fragments. In 's allocation, we will call fragments of size at least usable. Then at least of the total mass must be allocated in usable fragments, since at most mass can be allocated in unusable fragments. Now, a usable fragment of size can be divided into fragments of size , with at most mass remaining. Therefore, we can construct at least fragments of size within 's allocation. We define to allocate into the first of these memory locations.
ignores a request with the same probability as and breaks each request into equally sized fragments by construction. Because each allocation of during is a subset of the allocations made in on , .
To give the class of algorithms that we have reduced to so far a concrete name, say that an algorithm uses 1/4-selective (=k)-aligned-even-fragmentation if it is 1/4-tricky and breaks each request into k equal-sized fragments. Recall that an algorithm is said to be aligned if it allocates each request r (whose size is, WLOG, a power of two) to a region of the form for some non-negative integer j. We now prove that we can reduce to algorithms which are aligned.
Lemma B.3. Let A be a 1/4-selective algorithm that breaks each request into exactly equal-sized fragments. Let W be the set of workloads in which every request is a power-of-2 size. Then there exists a 1/4-selective ( )-aligned-even-fragmentation algorithm, B, such that for all , , where 2W refers to the workload which allocates requests of exactly 2 times the size of those in W.
Proof. We will simulate A and use its output to create B.
To allocate a request of size in , we simulate a request of size in . If ignores the request, then does too. Otherwise, for an allocated fragment of , the center of must fall within some -aligned block (possibly on its edge). Then must contain , since it is twice as large as . then allocates into .
is 1/4-selective and -aligned-even-fragmentation, because is and by construction. 's allocations are a subset of 's, so .
Combining Lemmas B.1 to B.3 show that Theorem 4.1 with the WLOG assumptions that is a power of 2 and M, R are powers of k, we can conclude that Theorem 4.1 reduces to Theorem 4.5.