Forced erl_crash.dump

Mats Cronqvist <>
Tue Aug 15 12:02:16 CEST 2006

Heinrich Venter wrote:
> Hi all
> Is there a way to force a running node to write a erl_crash.dump without
> actually killing the node?
> I am trying to figuire out what processes are running in a live node.
> Any suggestions how best to do this?

   assuming by "running" you mean which processes are using reductions, and that 
you're working in the shell, this should work;

define some trivial funs;
PI = fun(P,T)-> try element(2,process_info(P,T)) catch _:_ -> [] end end.
I = fun()-> [{P,PI(P,reductions)} || P <- processes()] end.
F = fun(G,[_X,_X|T],O) -> G(G,T,O); (G,[{P,R1},{P,R2}|T],O) -> 
G(G,T,[{R2-R1,P,PI(P,initial_call),PI(P,registered_name)}|O]);(_,[],O) -> 
lists:sublist(lists:reverse(lists:sort(O)),20); (G,[_|T],O) -> G(G,T,O) end.
GO = fun(T) -> X=I(), timer:sleep(T), F(F,lists:merge(X,I()),[]) end.


the arg of GO/1 is the tick in ms.
output is a list of {RedsLastTick,Pid,InitialCall,RegisteredName}.

if your system has many thousands of processes, don't try this:>


More information about the erlang-questions mailing list