2007-10-25
erlang的erl_crash.dump产生以及如何解读
关键字: erl_crash core dump- 正常情况下 当erlang进程发生错误没有catch的时候 emulator就会自动产生erl_crash.dump,来提供crash的时候的emulator最详细的情况,类似于unix的core dump. 其中下边几个env变量控制dump产生的行为:
-
ERL_CRASH_DUMP - If the emulator needs to write a crash dump, the value of this variable will be the file name of the crash dump file. If the variable is not set, the name of the crash dump file will be
erl_crash.dumpin the current directory.
-
ERL_CRASH_DUMP_NICE - Unix systems: If the emulator needs to write a crash dump, it will use the value of this variable to set the nice value for the process, thus lowering its priority. The allowable range is 1 through 39 (higher values will be replaced with 39). The highest value, 39, will give the process the lowest priority.
-
ERL_CRASH_DUMP_SECONDS - Unix systems: This variable gives the number of seconds that the emulator will be allowed to spend writing a crash dump. When the given number of seconds have elapsed, the emulator will be terminated by a SIGALRM signal.
1. erl控制台 CTRL+C 然后+A
2. kill -s SIGUSR1 erlpid
产生的erl_crash.dump是个纯文本, 可能非常大,特别是你有成千上万的process和port什么的,对于系统调优有非常大的意义。
察看方式参见文档 erl5.5.5/erts-5.5.5/doc/html/crash_dump.html 请注意内存使用有的是byte 有的是WORD.
更方便的是用工具 webtool 来察看 web界面 比较直观。
发表评论
提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则
- 浏览: 71934 次
- 性别:

- 来自: 广州

- 详细资料
搜索本博客
最近加入圈子
链接
最新评论
-
tail程序 c版本和lua版本 ...
不错,有点意思,支持一下楼主
-- by liuming -
tail程序 c版本和lua版本 ...
[root@test98 haproxy]# ls -lh /var/log/h ...
-- by mryufeng -
tail程序 c版本和lua版本 ...
把/var/log/haproxy.log拷三份来测比较准吧
-- by Sam1860 -
tail程序 c版本和lua版本 ...
算法基本一样, lua重复利用现有的c native 实现, c程序大概是lua ...
-- by mryufeng -
tail程序 c版本和lua版本 ...
你俩个算法都不一样比较啥啊?
-- by makefile






评论排行榜