skip to main content
article

Scalable lock-free dynamic memory allocation

Published:09 June 2004Publication History
Skip Abstract Section

Abstract

Dynamic memory allocators (malloc/free) rely on mutual exclusion locks for protecting the consistency of their shared data structures under multithreading. The use of locking has many disadvantages with respect to performance, availability, robustness, and programming flexibility. A lock-free memory allocator guarantees progress regardless of whether some threads are delayed or even killed and regardless of scheduling policies. This paper presents a completely lock-free memory allocator. It uses only widely-available operating system support and hardware atomic instructions. It offers guaranteed availability even under arbitrary thread termination and crash-failure, and it is immune to deadlock regardless of scheduling policies, and hence it can be used even in interrupt handlers and real-time applications without requiring special scheduler support. Also, by leveraging some high-level structures from Hoard, our allocator is highly scalable, limits space blowup to a constant factor, and is capable of avoiding false sharing. In addition, our allocator allows finer concurrency and much lower latency than Hoard. We use PowerPC shared memory multiprocessor systems to compare the performance of our allocator with the default AIX 5.1 libc malloc, and two widely-used multithread allocators, Hoard and Ptmalloc. Our allocator outperforms the other allocators in virtually all cases and often by substantial margins, under various levels of parallelism and allocation patterns. Furthermore, our allocator also offers the lowest contention-free latency among the allocators by significant margins.

References

  1. Sarita V. Adve and Kourosh Gharachorloo. Shared memory consistency models: A tutorial. IEEE Computer 29(12):66--76, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Emery D. Berger. Memory Management for High-Performance Applications PhD thesis, University of Texas at Austin, August 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Emery D. Berger, Kathryn S. McKinley, Robert D. Blumofe, and Paul R. Wilson. Hoard: A calable memory allocator for multithreaded applications. In Proceedings of the 9th International Conference on Architectural Support for Programming Languages and Operating Systems pages 117--128, November 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bruce M. Bigler, Stephen J. Allan, and Rodney R. Oldehoeft. Parallel dynamic torage allocation. In Proceedings of the 1985 International Conference on Parallel Processing pages 272--275, August 1985.Google ScholarGoogle Scholar
  5. Dave Dice and Alex Garthwaite. Mostly lock-free malloc. In Proceedings of the 2002 International Symposium on Memory Management pages 269--280, June 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Wolfram Gloger. Dynamic Memory Allocator Implementations in Linux System Libraries http://www.dent.med.uni-muenchen.de/~wmglo/.Google ScholarGoogle Scholar
  7. Maurice P. Herlihy. Wait-free synchronization. ACM Transactions on Programming Languages and Systems 13(1):124--149, January 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. IBM. IBM System/370 Extended Architecture, Principles of Operation 1983. Publication No. SA22-7085.Google ScholarGoogle Scholar
  9. IEEE. IEEE Std 1003.1, 2003 Edition 2003.Google ScholarGoogle Scholar
  10. Arun K. Iyengar. Dynamic Storage Allocation on a Multiprocessor PhDthei, MIT, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Arun K. Iyengar. Parallel dynamic storage allocation algorithms. In Proceedings of the Fifth IEEE Symposium on Parallel and Distributed Processing pages 82--91, December 1993.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Leslie Lamport. Concurrent reading and writing. Communications of the ACM 20(11):806--811, November 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Per-.Ake Larson and Murali Krishnan. Memory allocation for long-running server applications. In Proceedings of the 1998 International Symposium on Memory Management pages 176--185, October 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Doug Lea. A Memory Allocator http://gee.cs.oswego.edu/dl/html/malloc.htmlGoogle ScholarGoogle Scholar
  15. Chuck Lever and David Boreham. Malloc() performance in a multithreaded Linux environment. In Proceedings of the FREENIX Track of the 2000 USENIX Annual Technical Conference June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Maged M. Michael. High performance dynamic lock-free hash tables and list-based sets. In Proceedings of the Fourteenth Annual ACM Symposium on Parallel Algorithms and Architectures pages 73--82, August 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Maged M. Michael. Safe memory reclamation for dynamic lock-free objects using atomic reads and writes. In Proceedings of the Twenty-First Annual ACM Symposium on Principles of Distributed Computing pages 21--30, July 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Maged M. Michael. ABA prevention using single-word instructions. Technical Report RC 23089, IBM T. J. Watson Research Center, January 2004.Google ScholarGoogle Scholar
  19. Maged M. Michael. Hazard pointers: Safe memory reclamation for lock-free objects. IEEE Transactions on Parallel and Distributed Systems 2004. To appear. See www.research.ibm.com/people/m/michael/pubs.htm Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Maged M. Michael and Michael L. Scott. Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In Proceedings of the Fifteenth Annual ACM Symposium on Principles of Distributed Computing pages 267--275, May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Ori Shalev and Nir Shavit. Split-ordered lists: Lock-free extensible hash tables. In Proceedings of the Twenty-Second Annual ACM Symposium on Principles of Distributed Computing pages 102--111, July 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Josep Torrellas, Monica S. Lam, and John L. Hennessy. False haring and patial locality in multiprocessor caches. IEEE Transactions on Computers 43(6):651--663, June 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Paul R. Wilson, Mark S. Johnstone, Michael Neely, and David Boles. Dynamic torage allocation: A survey and critical review. In Proceedings of the 1995 International Workshop on Memory Management page 1--116, September 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Scalable lock-free dynamic memory allocation

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 39, Issue 6
            PLDI '04
            May 2004
            299 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/996893
            Issue’s Table of Contents
            • cover image ACM Conferences
              PLDI '04: Proceedings of the ACM SIGPLAN 2004 conference on Programming language design and implementation
              June 2004
              310 pages
              ISBN:1581138075
              DOI:10.1145/996841

            Copyright © 2004 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 9 June 2004

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader