An efficient non-moving garbage collector for functional languages

Katsuhiro Ueno, Atsushi Ohori, Toshiaki Otomo

Research output: Chapter in Book/Report/Conference proceedingConference contribution

7 Citations (Scopus)


Motivated by developing a memory management system that al-lows functional languages to seamlessly inter-operate with C, we propose an efficient non-moving garbage collection algorithm based on bitmap marking and report its implementation and performance evaluation. In our method, the heap consists of sub-heaps {Hi i c ≤ i ≤ B} of exponentially increasing allocation sizes (Hi for 2i bytes) and a special sub-heap for exceptionally large objects. Actual space for each sub-heap is dynamically allocated and reclaimed from a pool of fixed size allocation segments. In each allocation segment, the algorithm maintains a bitmap representing the set of live objects. Allocation is done by searching for the next free bit in the bitmap. By adding meta-level bitmaps that summarize the contents of bitmaps hierarchically and maintaining the current bit position in the bitmap hierarchy, the next free bit can be found in a small constant time for most cases, and in log32(segmentSize) time in the worst case on a 32-bit architecture. The collection is done by clearing the bitmaps and tracing live objects. The algorithm can be extended to generational GC by maintaining multiple bitmaps for the same heap space. The proposed method does not require compaction and objects are not moved at all. This property is significant for a functional language to inter-operate with C, and it should also be beneficial in supporting multiple native threads. The proposed method has been implemented in a full-scale Standard ML compiler. Our benchmark tests show that our non- moving collector performs as efficiently as a generational copying collector designed for functional languages.

Original languageEnglish
Title of host publicationICFP'11 - Proceedings of the 2011 ACM SIGPLAN International Conference on Functional Programming
Number of pages13
Publication statusPublished - 2011
Event16th ACM SIGPLAN International Conference on Functional Programming, ICFP'11 - Tokyo, Japan
Duration: 2011 Sep 192011 Sep 21

Publication series

NameProceedings of the ACM SIGPLAN International Conference on Functional Programming, ICFP


Other16th ACM SIGPLAN International Conference on Functional Programming, ICFP'11


  • Bitmap marking
  • Generational collectors
  • Non-moving garbage collection
  • SML#

ASJC Scopus subject areas

  • Software


Dive into the research topics of 'An efficient non-moving garbage collector for functional languages'. Together they form a unique fingerprint.

Cite this