Search code examples
memory-managementgarbage-collectionerlang

Garbage collection and memory management in Erlang


I want to know technical details about garbage collection (GC) and memory management in Erlang/OTP.

But, I cannot find on erlang.org and its documents.

I have found some articles online which talk about GC in a very general manner, such as what garbage collection algorithm is used.


Solution

  • A reference paper for the algorithm: One Pass Real-Time Generational Mark-Sweep Garbage Collection (1995) by Joe Armstrong and Robert Virding in 1995 (at CiteSeerX)

    Abstract:

    Traditional mark-sweep garbage collection algorithms do not allow reclamation of data until the mark phase of the algorithm has terminated. For the class of languages in which destructive operations are not allowed we can arrange that all pointers in the heap always point backwards towards "older" data. In this paper we present a simple scheme for reclaiming data for such language classes with a single pass mark-sweep collector. We also show how the simple scheme can be modified so that the collection can be done in an incremental manner (making it suitable for real-time collection). Following this we show how the collector can be modified for generational garbage collection, and finally how the scheme can be used for a language with concurrent processes.1