如何将Ctrl-Break发送到正在运行的Linux进程? [英] How can one send a Ctrl-Break to a running Linux process?
问题描述
我在Sun的JDK 1.4.2_18上运行的应用程序中调试内存泄漏。看来这个版本支持命令行参数-XX:+ HeapDumpOnCtrlBreak,它可能导致JVM在遇到控制中断时转储堆。如何将其发送到Linux机器上的后台进程?似乎杀死信号是应该工作的方式,但我杀了-l不会报告任何显然是Ctrl-Break的事情,至少在我的Ubuntu盒子上。
I am debugging a memory leak in an application running on Sun's JDK 1.4.2_18. It appears that this version supports the command line param -XX:+HeapDumpOnCtrlBreak which supposedly causes the JVM to dump heap when it encounters a control-break. How does one send this to a background process on a Linux box? It appears that kill signals are the way this ought to work, but I kill -l doesn't report anything that is obviously a Ctrl-Break, at least on my Ubuntu box.
更新:我测试了使用Sun JDK 1.4.2_18杀死-3(_14是第一个以这种方式转储堆),并且它有效。已创建堆转储文件,并且该进程仍在运行。
Update: I tested Kill -3 with Sun JDK 1.4.2_18 (_14 was the first to dump heap this way), and it worked. A heap dump file was created, and the process was still running.
推荐答案
kill -QUIT可能会执行此操作(它将生成一个在Windows上由ctrl-break生成的线程转储。虽然我没有尝试使用堆转储选项。
kill -QUIT might do it (it will generate a thread dump which is generated by ctrl-break on windows. I haven't tried it with the heap dump option though).
这篇关于如何将Ctrl-Break发送到正在运行的Linux进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!