BEAM Processes: 1000x Smaller Memory Footprint

Erlang's BEAM processes typically start with a memory footprint of only ~2-3 KB, allowing millions of concurrent processes on a single machine, whereas traditional OS threads often consume 1-2 MB each, drastically limiting the total number that can be run due to memory constraints.

The top 3

  1. BEAM Processes vs. JVM Threads: Memory Footprint Showdown: BEAM processes are exceptionally lightweight, starting at approximately 2-3 KB, whereas typical JVM threads consume 1-2 MB of memory due to larger stack sizes, making BEAM processes up to 1,000 times more memory efficient.
  2. Private Heaps: The Core of BEAM's Memory Isolation: Each BEAM process maintains its own isolated, private heap and stack, preventing shared memory overhead and allowing for independent, localized garbage collection without 'stop-the-world' pauses.
  3. Millions Concurrent: BEAM's Scalability Advantage: The minimal memory footprint of BEAM processes, managed by the Erlang VM rather than the OS, enables a single machine to efficiently run hundreds of thousands or even millions of concurrent processes, a scale impractical for systems relying on heavier OS threads.

Sources

Open the full topic