ThreadScan: Automatic and scalable memory reclamation

Dan Alistarh, William Leiserson, Alexander Matveev, Nir Shavit

Research output: Contribution to journalArticlepeer-review


The concurrent memory reclamation problem is that of devising a way for a deallocating thread to verify that no other concurrent threads hold references to a memory block being deallocated. To date, in the absence of automatic garbage collection, there is no satisfactory solution to this problem; existing tracking methods like hazard pointers, reference counters, or epoch-based techniques like RCU are either prohibitively expensive or require significant programming expertise to the extent that implementing them efficiently can be worthy of a publication. None of the existing techniques are automatic or even semi-automated. In this article, we take a new approach to concurrent memory reclamation. Instead of manually tracking access to memory locations as done in techniques like hazard pointers, or restricting shared accesses to specific epoch boundaries as in RCU, our algorithm, called ThreadScan, leverages operating system signaling to automatically detect which memory locations are being accessed by concurrent threads. Initial empirical evidence shows that ThreadScan scales surprisingly well and requires negligible programming effort beyond the standard use of Malloc and Free.

Original languageEnglish
Article number18
JournalACM Transactions on Parallel Computing
Issue number4
StatePublished - Sep 2018
Externally publishedYes


  • Concurrent data structures
  • Lock-based data structures
  • Lock-free data structures
  • Memory reclamation


Dive into the research topics of 'ThreadScan: Automatic and scalable memory reclamation'. Together they form a unique fingerprint.

Cite this