Releasing Memory with Optimistic Access: A Hybrid Approach to Memory Reclamation and Allocation in Lock-Free Programs

Pedro Moreno and Ricardo Rocha

June 2023


Abstract

Lock-free data structures are an important tool for the development of concurrent programs as they provide scalability, low latency and avoid deadlocks, livelocks and priority inversion. However, they require some sort of additional support to guarantee memory reclamation. The Optimistic Access (OA) method has most of the desired properties for memory reclamation, but since it allows memory to be accessed after being reclaimed, it is incompatible with the traditional memory management model. This renders it unable to release memory to the memory allocator/operating system, and, as such, it requires a complex memory recycling mechanism. In this paper, we extend the lock-free general purpose memory allocator LRMalloc to support the OA method. By doing so, we are able to simplify the memory reclamation method implementation and also allow memory to be reused by other parts of the same process. We further exploit the virtual memory system provided by the operating system and hardware in order to make it possible to release reclaimed memory to the operating system.

Bibtex

@InProceedings{moreno-spaa23,
  author =    {P. Moreno and R. Rocha},
  title =     {{Releasing Memory with Optimistic Access: A Hybrid Approach to Memory Reclamation and
                Allocation in Lock-Free Programs}},
  booktitle = {Proceedings of the 35th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA 2023)}, 
  pages =     {177--186},
  publisher = {ACM},
  editor =    {K. Agrawal and J. Shun},
  month =     {June},
  year =      {2023},
  address =   {Orlando, Florida, USA},
}

Download Paper

PDF file
ACM Digital Library