Garbage collection in Elixir

I am trying to see if there is any material which discusses how Elixir does GC. I understand that the data-structures are immutable and that copies(when needed) and PDT (Persistent Data structures are used). But that’s the level i know about it.

I see that for other GC’ed langauges like Python and even Golang there are multiple articles which explains how GC happens.

Can you guys point me to articles/books which explain how this happens and/or point me to the elixir source code where GC takes place.


1 Like

The path to the right answer is found by asking about how Erlang and the BEAM do garbage collection, since the BEAM is the actual VM that executes your Elixir code. Erlang -- Erlang Garbage Collector is a great summary to start.


Thanks a lot. I just started writing some code in Elixir and kind of love the syntax (inviting) and the great support i receive online. I now realize that need to do some studying.

Many a thanks


Garbage collection in BEAM is very interesting and different as it is per BEAM process so nothing stops you globally. You have N different BEAM processes that are independently garbage collected and this makes Erlang/Elixir a unique language.

Thanks a lot