Generally catch dump 4 ways: 1. Erlang:halt ("Abort"). 2. Under Erlang shell, enter CTRL C + "uppercase a" 3. Wait for the process to crash itself generate dump 4.KILL-SIGUSR1 <pid> (can be used when the shell is inaccessible) but 4 ways no need no De crash off, what if I just want to sapshot a process state for analysis? Find the answer in Google Groups, now the link can not find, share:
Crash_dump ()Date=erlang:list_to_binary (Rfc1123_local_date ()), Header= Binary:list_to_bin ([<< "=erl_crash_dump:0.2\n" >>,Date,<< "\nsystem version:" >>]), Ets=ets_info (), report=Binary:list_to_bin ([Header,erlang:list_to_binary (Erlang:system_info (system_version)), Erlang:system_info (info), Erlang:system_info (procs), Ets,erlang:system_info (Dist),<< "=loaded_modules\n" >>, Binary:replace (Erlang:system_info (loaded), << "\ n" >>,<< "\n=mod:" >>, [Global]]), File:write_file ("Erl_crash.dump", Report). Ets_info ()-Binary:list_to_bin ([Ets_table_info (T)|| t<-Ets:all ()]). Ets_table_info (table)-Info=Ets:info (Table), Owner=erlang:list_to_binary (Erlang:pid_to_list (Proplists:get_value (Owner,info)), Tablen=erlang:list_to_binary (Erlang:atom_to_list (Proplists:get_value (Name,info))), name=erlang:list_to_binary (Erlang:atom_to_list (Proplists:get_value (Name,info)), Objects=erlang:list_to_binary (Erlang:integer_to_list (Proplists:get_value (Size,info)), Binary:list_to_bin ([<< "=ets:" >>,Owner,<< "\ntable:" >>,TableN,<< "\nname:" >>, Name,<< "\nobjects:" >>,Objects,<< "\ n" >>]). Rfc1123_local_date ()-rfc1123_local_date (Os:timestamp ()). Rfc1123_local_date ({a,b,c})-Rfc1123_local_date (Calendar:now_to_local_time ({a,b,c})); Rfc1123_local_date ({{yyyy,mm,dd},{hour,min,sec}}) -Daynumber=Calendar:day_of_the_week ({yyyy,mm,dd}), Lists:flatten (Io_lib:format ("~s, ~2.2.0w ~3.s ~4.4.0w ~2.2.0w:~2.2.0w:~2.2.0w GMT", [Httpd_util:day (Daynumber), Dd,httpd_util:month (MM), yyyy,hour,min,sec])); Rfc1123_local_date (Epoch) whenErlang:is_integer (Epoch)rfc1123_local_date (calendar:gregorian_seconds_to_datetime (Epoch+62167219200)).
Erlang's crash dump is a text file of a process detail snapshot, in which a similar file is stitched together, and Crash_dumpviewer will have a warning, but it still works.
Reference: Erl_crash.dump generation of Erlang and how to interpret it
Erlang Online Generation CrashDump