[erlang-questions] 14 seconds from disaster

Kostis Sagonas kostis@REDACTED
Wed Mar 19 08:01:26 CET 2014


On 03/19/2014 05:08 AM, Richard A. O'Keefe wrote:
> I tried this on two machines with different CPUs and operating systems.
>
> 1> [if N rem 10000 == 0 -> io:write(N), io:nl(), A ; true -> A end
> 1> || N <- lists:seq(1,10000000),
> 1>     A <- [list_to_atom(integer_to_list(N))]].
>
> This tries to create 10,000,000 atoms, reporting every 10,000.
>
> After just 14 seconds 'beam.smp' goes to 95% CPU and stays there,
> busy doing oodles of system calls (including pthead_cond_wait)
> and getting nowhere.
>
> *That*  is a negative performance impact.

Your experiment has very little to do with performance. What happens 
after 14 seconds in your machine is that the VM crashes because it 
exceeds the the maximum number of index entries in the atom table (whose 
default value is 1048576). For better or worse, the system then tries to 
write a huge erl_crash.dump file and this naturally takes long.

Of course this is not nice, but has nothing to do with VM performance 
for `normal' program execution; it has to do with what happens when the 
VM crashes.

Kostis



More information about the erlang-questions mailing list