One erlang process is composed of a PCB, a Stack and a Private Heap.

Erlang Process

When a list or tuple is created in a process, there will be a pointer stacked in
the process stack, and the elements of the list or tuple created in private heap.
The pointer in the stack points to the position of the elememts. Just like the
picture shows below:

List and Tuple

A = [a, b, c],
C = [x, r | A].

If A is part of C, just like the picture shows, only need to add object x, object r
on heap.

Heap structure

Look at this code, if we run test2, it cost about 100 times slower than test1,
but if we run bigheap2, it almost as fast as test1. Why? Because we increase the
min_heap_size of the process which we spawned, the min_heap_size option is threshold
of garbage collection. It is the size of the generation. If the min_heap_size is
large enough, the number of garbage collection will be very small. Usually min_heap_size
will be very small when beam spawn a new process, the garbage collector always grow
the heap step by step, but it is more costly than directly establishing a larger
heap when the process is spawned. The garbage collector can also shrink the heap
if it is much larger than the amount of data stored on it; setting the minimum
heap size prevents that.

The emulator probably uses more memory, and because garbage collections occur
less frequently, huge binaries can be kept much longer.