$ ulimit -c unlimited
$ gdb --pid=26426
(gdb) gcore
Saved corefile core.26426
(gdb) detatch
http://stackoverflow.com/questions/68160/is-it-possible-to-get-a-core-dump-of-a-running-process-and -
本文介绍如何使用ulimit和gdb工具为正在运行的进程生成核心转储文件(core dump),这对于故障排查非常有用。通过设置ulimit无限制并利用gdb的gcore命令,可以在不需要停止进程的情况下捕获内存快照。
$ ulimit -c unlimited
$ gdb --pid=26426
(gdb) gcore
Saved corefile core.26426
(gdb) detatch
http://stackoverflow.com/questions/68160/is-it-possible-to-get-a-core-dump-of-a-running-process-and -
519

被折叠的 条评论
为什么被折叠?