Inside memory management on the BEAM
summary
Explains why the BEAM cannot turn off garbage collector (per-process heaps and contiguous heap+stack), shows using spawn_opt minimum heap 65535 words vs default ~233 to reduce GC spikes, and implements memory measurement by tracing GC events with erlang:trace/3. Covers generational GC (minor vs major heaps), a bug fix to include old-heap accounting, and a race fix that starts the tracer before setting the trace flag; the final Benjy/Vinci feature works reliably.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 7:00SpawnOpt
- 20:52Bugs
- 23:34Debugging
- 27:47What can you do
- 35:20Memory management on the BEAM
- 38:40Snapshots
- 39:07Garbage collection
- 40:45Runtime measurements
- 41:45Spawn opt
- 45:19The solution
- 50:13The module
- 52:05Start tracer function
- 55:01The second heap
related talks
48mGetting to Know the Erlang Virtual Machine, the BEAM
29mSqueezing the BEAM into 16MB
42mMemory Management: Battle Stories
44mBattling Memory Leaks: Tales from the Trenches at WhatsApp
19mErlang/OTP Update
24mFantastic Voyage III: Destination BEAM
24mThe Yin and Yang of Mutability
42mThe Soul of Erlang and Elixir
