Advertisement

Acta Informatica

, Volume 41, Issue 4–5, pp 273–291 | Cite as

Fast allocation and deallocation with an improved buddy system

  • Gerth Stølting Brodal
  • Erik D. Demaine
  • J. Ian Munro
Article

Abstract.

We propose several modifications to the binary buddy system for managing dynamic allocation of memory blocks whose sizes are powers of two. The standard buddy system allocates and deallocates blocks in \(\Theta(\lg n)\) time in the worst case (and on an amortized basis), where n is the size of the memory. We present three schemes that improve the running time to O(1) time, where the time bound for deallocation is amortized for the first two schemes. The first scheme uses just one more word of memory than the standard buddy system, but may result in greater fragmentation than necessary. The second and third schemes have essentially the same fragmentation as the standard buddy system, and use \(O(2^{(1 + \sqrt{\lg n}) \lg \lg n})\) bits of auxiliary storage, which is \(\omega(\lg^k n)\) but \(o(n^\varepsilon)\) for all \(k \geq 1\) and \(\varepsilon > 0\). Finally, we present simulation results estimating the effect of the excess fragmentation in the first scheme.

Keywords

Information System Operating System Data Structure Communication Network Information Theory 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Barkley, R.E., Lee, T.P. (1989) A lazy buddy system bounded by two coalescing delays per class. Operating Systems Review Dec.: 167-176Google Scholar
  2. 2.
    Brodnik, A. (1993) Computation of the least significant set bit. In: Proceedings of the 2nd Electrotechnical and Computer Science Conference, Portoroz, SloveniaGoogle Scholar
  3. 3.
    Bromley, A.G. (1976) An improved buddy method for dynamic storage allocation. In: Proceedings of the 7th Australian Computer Conference, pp. 708-715Google Scholar
  4. 4.
    Bromley, A.G. (1980) Memory fragmentation in buddy methods for dynamic storage allocation. Acta Informatica 14: 107-117Google Scholar
  5. 5.
    Burton, W. (1976) A buddy system variation for disk storage allocation. Communications of the ACM 19(7): 416-417Google Scholar
  6. 6.
    Chowdhury, S.K., Srimani, P.K.: Worst case performance of weighted buddy systems. Acta Informatica 24(5): 555-564Google Scholar
  7. 7.
    Cranston, B., Thomas, R. (1975) A simplified recombination scheme for the Fibonacci buddy system. Communications of the ACM 18(6): 331-332Google Scholar
  8. 8.
    Demaine, E.D., Munro, J.I. (1999) Fast Allocation and Deallocation with an Improved Buddy System. In: Proceedings of the 19th Conference on the Foundations of Software Technology and Theoretical Computer Science (FST & TCS’99), Lecture Notes in Computer Science, vol. 1738. Chennai, India, December 13-15, 1999, pp. 84-96Google Scholar
  9. 9.
    Hinds, J.A. (1975) Algorithm for locating adjacent storage blocks in the buddy system. Communications of the ACM 18(4): 221-222Google Scholar
  10. 10.
    Hirschberg, D.S. (1973) A class of dynamic memory allocation algorithms. Communications of the ACM 16(10): 615-618Google Scholar
  11. 11.
    Kaufman, A. (1984) Tailored-list and recombination-delaying buddy systems. ACM Transactions on Programming Languages and Systems 6(1): 118-125Google Scholar
  12. 12.
    Knowlton, K.C. (1965) A fast storage allocator. Communications of the ACM 8(10): 623-625Google Scholar
  13. 13.
    Knowlton, K.C. (1966) A programmer’s description of L6. Communications of the ACM 9(8): 616-625Google Scholar
  14. 14.
    Knuth, D.E. (1968) Dynamic storage allocation. In: The art of computer programming, vol. 1, Sect. 2.5, pp. 435-455. Addison-WesleyGoogle Scholar
  15. 15.
    Koch, P.D.L. (1987) Disk file allocation based on the buddy system. ACM Transactions on Computer Systems 5(4): 352-370Google Scholar
  16. 16.
    Lee, T.P., Barkley, R.E. (1989) Design and evaluation of a watermark-based lazy buddy system. Performance Evaluation Review 17(1): 230Google Scholar
  17. 17.
    Lee, T.P., Barkley, R.E. (1989) A watermark-based lazy buddy system for kernel memory allocation. In: Proceedings of the 1989 Summer USENIX Conference, June, pp. 1-13Google Scholar
  18. 18.
    Lloyd, E.L., Loui, M.C. (1985) On the worst case performance of buddy systems. Acta Informatica 22(4): 451-473Google Scholar
  19. 19.
    McKusick, M.K., Bostic, K., Karels, M.J., Quarterman, J.S. (1996) The design and implementation of the 4.4 BSD operating system. Addison-WesleyGoogle Scholar
  20. 20.
    Page, I.P., Hagins, J. (1986) Improving the performance of buddy systems. IEEE Transactions on Computers C-35(5): 441-447Google Scholar
  21. 21.
    Peterson, J.L., Norman, T.A. (1977) Buddy systems. Communications of the ACM 20(6): 421-431Google Scholar
  22. 22.
    Purdom, P.W. Jr., Stigler, S.M. (1970) Statistical properties of the buddy system. Journal of the ACM 17(4): 683-697Google Scholar
  23. 23.
    Russell, D.L. (1977) Internal fragmentation in a class of buddy systems. SIAM Journal on Computing 6(4): 607-621Google Scholar
  24. 24.
    Shen, K.K., Peterson, J.L. (1974) A weighted buddy method for dynamic storage allocation. Communications of the ACM 17(10): 558-562. See also the corrigendum in 18(4): 202 (Apr. 1975)Google Scholar

Copyright information

© Springer-Verlag Berlin/Heidelberg 2005

Authors and Affiliations

  • Gerth Stølting Brodal
    • 1
  • Erik D. Demaine
    • 2
  • J. Ian Munro
    • 3
  1. 1.BRICS, Department of Computer ScienceUniversity of AarhusÅrhus NDenmark
  2. 2.MIT Computer Science and Artificial Intelligence LaboratoryCambridgeUSA
  3. 3.School of Computer ScienceUniversity of WaterlooWaterlooCanada

Personalised recommendations