A provably efficient algorithm for dynamic storage allocation

Abstract The design and analysis of algorithms for on-line dynamic storage allocation has been a fundamental problem area in computer science for many years. In this paper we study the stochastic behavior of dynamic allocation algorithms under the natural assumption that files enter and leave the system according to a Poisson process. In particular, we prove that for any dynamic allocation algorithm and any distribution of file sizes, the expected wasted space (or fragmentation) in the system at any time is Ω(√N √ log log N) , where N is the expected number of items (or used space) in the system. This result is known to be tight in the special case when all files have the same size. More importantly, we also construct a dynamic allocation algorithm which for any distribution of file sizes wastes only O(√N log 3 4 N) space with very high probability. This bound is also shown to be tight for a wide variety of file-size distributions, including for example the uniform and normal distributions. The results are significant because they show that the cumulative wasted space in the holes formed by the continual arrival and departure of items is a vanishingly small portion of the used space, at least on the average. This fact is in striking contrast with Knuth's well-known 50% rule which states that the number of these holes is linear in the used space. Moreover, the proof techniques establish a surprising connection between stochastic processes, such as dynamic allocation, and static problems such as bin-packing and planar matching. We suspect that the techniques will also prove useful in analyzing other stochastic processes which might otherwise prove intractable. Lastly, we present experimental data in support of the theoretical proofs, and as a basis for postulating several conjectures.

[1]  V. E. Beneš Models and Problems of Dynamic Memory Allocation , 1982 .

[2]  I. P. Page Optimal Fit Of Arbitrary Sized Segments , 1982, Comput. J..

[3]  Edward G. Coffman,et al.  Algorithms for resolving conflicts in dynamic storage allocation , 1985, JACM.

[4]  S. Berman Stationary and Related Stochastic Processes , 1967 .

[5]  Jr. E. G. Coffman An Introduction to Combinatorial Models of Dynamic Storage Allocation , 1983 .

[6]  Edward G. Coffman,et al.  A Stochastic Model of Fragmentation in Dynamic Storage Allocation , 1985, SIAM J. Comput..

[7]  Edward G. Coffman,et al.  On the Asymptotic Optimality of First-Fit Storage Allocation , 1985, IEEE Transactions on Software Engineering.

[8]  Feller William,et al.  An Introduction To Probability Theory And Its Applications , 1950 .

[9]  Gordon F. Newell,et al.  The M/M/⁰⁰ service system with ranked servers in heavy traffic , 1984 .

[10]  Frank Thomson Leighton,et al.  Tight bounds for minimax grid matching, with applications to the average case analysis of algorithms , 1986, STOC '86.

[11]  John E. Shore On the external storage fragmentation produced by first-fit and best-fit allocation strategies , 1975, CACM.

[12]  John Michael Robson,et al.  Worst Case Fragmentation of First Fit and Best Fit Storage Allocation Strategies , 1977, Comput. J..

[13]  Donald E. Knuth,et al.  fundamental algorithms , 1969 .

[14]  D. Iglehart Limiting diffusion approximations for the many server queue and the repairman problem , 1965, Journal of Applied Probability.

[15]  Thomas A. Standish Data Structure Techniques , 1980 .

[16]  H. Chernoff A Measure of Asymptotic Efficiency for Tests of a Hypothesis Based on the sum of Observations , 1952 .

[17]  D. Aldous Some interesting processes arising as heavy traffic limits in an M/M/∞ storage process , 1986 .

[18]  D. Iglehart Weak convergence of compound stochastic process, I , 1973 .

[19]  Richard M. Karp,et al.  A probabilistic analysis of multidimensional bin packing problems , 1984, STOC '84.

[20]  harald Cramer,et al.  Stationary And Related Stochastic Processes , 1967 .