Erlang / Erlang Advanced Interview questions
Explain the internal working of Erlang's per-process garbage collector?
Each Erlang process has its own private heap, so garbage collection happens independently, one process at a time, rather than as one global stop-the-world pause across the whole node. When a process's heap fills up (typically triggered by a message arriving or an allocation), the BEAM runs a generational collector scoped to just that process.
flowchart LR
A[Process heap fills] --> B[Minor GC: copy live young data]
B --> C{Data survives multiple minor GCs?}
C -->|Yes| D[Promoted to old generation]
C -->|No| E[Reclaimed]
D --> F[Old generation collected less often]
Young, short-lived data gets collected frequently and cheaply (minor GC); data that survives several collections is promoted to an older generation that's swept less often, on the assumption that data still alive after multiple passes is likely to stay alive. Because each process's heap is small and private, these pauses are usually sub-millisecond and invisible to every other process on the node.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
