ufm: (Default)
[personal profile] ufm

ufm@imac:~$ erl
Erlang (BEAM) emulator version 5.6.5 [source] [smp:2] [async-threads:0] [kernel-poll:false]

Eshell V5.6.5 (abort with ^G)
1> A=[255||X<-lists:seq(1,20000000)],ok.
ok
2> B=list_to_binary(A).
<<”\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377″…>>
3>
3> byte_size(B).
20000000
4> byte_size(B).
20000000
5> byte_size(B).
20000000

Crash dump was written to: erl_crash.dump
eheap_alloc: Cannot allocate 912262800 bytes of memory (of type “heap”).
Aborted

Originally published at U.F.M's Homepage. Please leave any comments there.