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

Anton Lebedevich <>
Thu Feb 20 09:26:16 CET 2014


On 02/19/2014 04:00 AM, 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.

Another thing which I missed a lot after converting from java to erlang
is a thread dump. It turned out that it's possible to get all
stacktraces for all processes (even with function arguments) via
erlang:system_info(procs).

It returns them as text so it's better to dump it to file immediately:
file:write_file("/tmp/procs.txt",erlang:system_info(procs)).

Format of these traces is quite interesting (undocumented) the best
description I found is in the mailing list
http://erlang.org/pipermail/erlang-questions/2012-November/070609.html

Regards,
Anton Lebedevich.



More information about the erlang-questions mailing list