[erlang-questions] Creating a diagnostic memory dump of live erlang VM

Fred Hebert mononcqc@REDACTED
Wed Feb 19 13:49:48 CET 2014


Part of the information available in an Erlang crash dump can be
obtained during runtime. The following strings will return system
information seen in crash dumps:

erlang:system_info(dist),   (distribution information)
erlang:system_info(info),   (misc system info)
erlang:system_info(loaded), (loaded module information)
erlang:system_info(procs),  (process heaps and stacktraces)

You can print out this information (be careful because it can be
freaking huge), and try to understand it by going through
http://www.erlang.org/doc/apps/erts/crash_dump.html (the format isn't
rxactly the same as a crashdump, but maybe the viewer can work, the one
recommended by Geoff).

Some info will be missing from this one to be a real crash dump: tables
of refc binaries, atom tables, etc. For binaries, they can be inspected
at run time by calling process_info(Pid, binary) and getting a list of
all the refc binaries owned by a process. This, again, can have quite a
heavy cost depending on how many processes (and binaries) you have.

Otherwise, you'll need to crash a node.

Regards,
Fred.

On 02/19, Vladimir Ralev wrote:
> Hello all,
> 
> As a Java developer I really miss being able to create a "heap dump" of a
> live Erlang VM where I can see the objects in each process and the current
> process stack variables/trace. I realise there is no java-like heap in
> Erlang but there are the processes, mailboxes, stacks, file handles,
> sockets, ets and so on.
> 
> In Java we can also use query tools to search the heaps for specific
> identifying strings/numbers/timestamps to find a graph of related objects.
> You can go find objects by type or find the stack variables for given
> thread. It would be very useful for understanding the system in production
> and diagnose issues.
> 
> Would it be possible to have something like this in Erlang or it is
> fundamentally not allowed?

> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list