Skip to main content

Fast Allocation and Deallocation with an Improved Buddy System

  • Conference paper
  • First Online:
Foundations of Software Technology and Theoretical Computer Science (FSTTCS 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1738))

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 Θ(lg n) time in the worst case (and on an amortized basis), where n is the size of the memory. We present two schemes that improve the running time to O(1) time, where the time bound for deallocation is amortized. The first scheme uses one word of extra storage compared to the standard buddy system, but may fragment memory more than necessary. The second scheme has essentially the same fragmentation as the standard buddy system, and uses \( O(2^{(1 + \sqrt {\lg n} )\lg \lg n} )\) bits of auxiliary storage, which is ω(lgk n) but o(n ε) for all k ≥ 1 and ε > 0. Finally, we present simulation results estimating the effect of the excess fragmentation in the first scheme.

This work was supported by the Natural Science and Engineering Research Council of Canada (NSERC).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. R. E. Barkley and T. Paul Lee. A lazy buddy system bounded by two coalescing delays per class. Operating Systems Review, pages 167–176, Dec. 1989. 95

    Google Scholar 

  2. Andrej Brodnik. Computation of the least significant set bit. In Proceedings of the 2nd Electrotechnical and Computer Science Conference, Portoroz, Slovenia, 1993. 90

    Google Scholar 

  3. Allan G. Bromley. An improved buddy method for dynamic storage allocation. In Proceedings of the 7th Australian Computer Conference, pages 708–715, 1976. 86

    Google Scholar 

  4. Allan G. Bromley. Memory fragmentation in buddy methods for dynamic storage allocation. Acta Informatica, 14:107–117, 1980. 86, 86

    Article  Google Scholar 

  5. Warren Burton. A buddy system variation for disk storage allocation. Communications of the ACM, 19(7):416–417, July 1976. 86

    Article  MathSciNet  Google Scholar 

  6. Shyamal K. Chowdhury and Pradip K. Srimani. Worst case performance of weighted buddy systems. Acta Informatica, 24(5):555–564, 1987. 86

    Article  MATH  MathSciNet  Google Scholar 

  7. Ben Cranston and Rick Thomas. A simplified recombination scheme for the Fibonacci buddy system. Communications of the ACM, 18(6):331–332, June 1975. 86

    Article  Google Scholar 

  8. James A. Hinds. Algorithm for locating adjacent storage blocks in the buddy system. Communications of the ACM, 18(4):221–222, Apr. 1975. 86

    Article  Google Scholar 

  9. Daniel S. Hirschberg. A class of dynamic memory allocation algorithms. Communications of the ACM, 16(10):615–618, Oct. 1973. 86

    Article  MATH  Google Scholar 

  10. Arie Kaufman. Tailored-list and recombination-delaying buddy systems. ACM Transactions on Programming Languages and Systems, 6(1):118–125, Jan. 1984. 95

    Article  Google Scholar 

  11. Kenneth C. Knowlton. A fast storage allocator. Communications of the ACM, 8(10):623–625, Oct. 1965. 85

    Article  MATH  Google Scholar 

  12. Kenneth C. Knowlton. A programmer’s description of L6. Communications of the ACM, 9(8):616–625, Aug. 1966. 85

    Article  Google Scholar 

  13. Donald E. Knuth. Dynamic storage allocation. In The Art of Computer Programming, volume 1, section 2.5, pages 435–455. Addison-Wesley, 1968. 84, 85, 86, 92

    MathSciNet  Google Scholar 

  14. Philip D. L. Koch. Disk file allocation based on the buddy system. ACM Transactions on Computer Systems, 5(4):352–370, Nov. 1987. 86

    Article  Google Scholar 

  15. T. Paul Lee and R. E. Barkley. Design and evaluation of a watermark-based lazy buddy system. Performance Evaluation Review, 17(1):230, May 1989. 95

    Google Scholar 

  16. T. Paul Lee and R. E. Barkley. A watermark-based lazy buddy system for kernel memory allocation. In Proceedings of the 1989 Summer USENIX Conference, pages 1–13, June 1989. 95

    Google Scholar 

  17. Errol L. Lloyd and Michael C. Loui. On the worst case performance of buddy systems. Acta Informatica, 22(4):451–473, 1985. 86

    Article  MATH  MathSciNet  Google Scholar 

  18. Marshall Kirk McKusick, Keith Bostic, Michael J. Karels, and John S. Quarterman. The Design and Implementation of the 4.4 BSD Operating System. Addison-Wesley, 1996. 85, 88, 94

    Google Scholar 

  19. Ivor P. Page and Jeff Hagins. Improving the performance of buddy systems. IEEE Transactions on Computers, C-35(5):441–447, May 1986. 86

    Article  Google Scholar 

  20. James L. Peterson and Theodore A. Norman. Buddy systems. Communications of the ACM, 20(6):421–431, June 1977. 86, 86

    Article  MATH  Google Scholar 

  21. Paul W. Purdom, Jr. and Stephen M. Stigler. Statistical properties of the buddy system. Journal of the ACM, 17(4):683–697, Oct. 1970. 86

    Article  MATH  Google Scholar 

  22. David L. Russell. Internal fragmentation in a class of buddy systems. SIAM Journal on Computing, 6(4):607–621, Dec. 1977. 86, 86

    Article  MATH  MathSciNet  Google Scholar 

  23. Kenneth K. Shen and James L. Peterson. A weighted buddy method for dynamic storage allocation. Communications of the ACM, 17(10):558–562, Oct. 1974. See also the corrigendum in 18(4):202, Apr. 1975. 86

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Demaine, E.D., Munro, I.J. (1999). Fast Allocation and Deallocation with an Improved Buddy System. In: Rangan, C.P., Raman, V., Ramanujam, R. (eds) Foundations of Software Technology and Theoretical Computer Science. FSTTCS 1999. Lecture Notes in Computer Science, vol 1738. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46691-6_7

Download citation

  • DOI: https://doi.org/10.1007/3-540-46691-6_7

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66836-7

  • Online ISBN: 978-3-540-46691-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics