I've started reading about the Elixir programming language.
I understand that:
My question is: Does it have a sort of GC?
If there isn't enough space in memory to put new information, garbage collection is launched. It removes data that's no longer necessary for the app to work, and then the app resumes. Erlang uses GC that separate objects in the heap into two categories: long-term and short-term.
Erlang has a copying semi-space garbage collector. This means that when doing a garbage collection, the terms are copied from one distinct area, called the from space, to a new clean area, called the to space. The collector starts by scanning the root-set (stack, registers, etc).
To force a garbage collection, use the hotkey: Ctrl+Alt+Shift+F12, Ctrl+Alt+Shift+F12 (press it twice). If forcing garbage collection reliably makes your scenario work, file a report through the Visual Studio feedback tool as this behavior is likely to be a bug.
Yes, Erlang has GC, and since Elixir is built on Erlang it too has GC. See this old SO answer about Erlang GC and this one. The Elixir site refers to GC as follows:
Due to their lightweight nature, it is not uncommon to have hundreds of thousands of processes running concurrently in the same machine. Isolation allows processes to be garbage collected independently, reducing system-wide pauses, and using all machine resources as efficiently as possible (vertical scaling).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With