Hi fellas,
I just noticed that the erl_crash.dump file grew to 7.7 gigs in my local machine. How ? If I were to use elixir in a production server that would be a huge issue, wouldnt it?
Hi fellas,
I just noticed that the erl_crash.dump file grew to 7.7 gigs in my local machine. How ? If I were to use elixir in a production server that would be a huge issue, wouldnt it?
You can control the size of a crash dump. By setting the environment variable ERL_CRASH_DUMP_BYTES
you can limit the size. (From Erlang/OTP 19.2). Set to 0 to disable writing of crash dumps.
More info: http://erlang.org/doc/man/erl.html
Search for ERL_CRASH_DUMP.
Example:
# Start iex with limites dump bytes
$ ERL_CRASH_DUMP_BYTES=2048 iex
iex(1)>
...
# From another shell find and kill the iex process
$ kill -SIGUSR1 7063
# Shell will say:
iex(1)> Received SIGUSR1
Crash dump is being written to: erl_crash.dump...
$ ls -lh erl_crash.dump
-rw-r----- 1 xxxx xxxx 2.1K Jun 6 20:32 erl_crash.dump
$ tail -1 erl_crash.dump
=abort:CRASH DUMP SIZE LIMIT REACHED
Limiting the size of the crash dump is of course a trade-off as the crash dumps can be really useful for debugging