Windows上的Java堆栈转储 [英] java stack dump on windows

查看:250
本文介绍了Windows上的Java堆栈转储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在标准的Windows命令窗口中有一个正在运行的java进程。即我已经运行'cmd'并输入java -jar ...

I have a running java process in a standard windows command window. ie i have run 'cmd' and typed in java -jar ...

如果可能的话,我需要能够获得所有线程的完整堆栈转储。

I need to be able to get a full stack dump of all threads if at all possible.

我记得在linux下你可以通过quit命令上的一个选项向JVM发送一条消息。

i remember that under linux you can send a message to the JVM via an option on the quit command.

此文档太阳州


要在Windows
95或Windows NT平台上生成堆栈跟踪,请在
窗口中输入
键序列,其中Java程序是
正在运行,或点击
窗口上的关闭按钮。

To generate a stack trace on Windows 95, or Windows NT platforms, enter the key sequence in the window where the Java program is running, or click the Close button on the window.

这显然是错误的,因为关闭终端只会杀死进程并关闭窗口。

this is clearly wrong, as closing the terminal does nothing but kill the process and close the window.

推荐答案

键入 Ctrl + Break 是在Windows上生成线程转储的正确方法。

Typing Ctrl+Break is the correct way to generate a thread dump on Windows.

你是按 Ctrl + C (=中断)吗?这将发送一个SIGINT,通常会杀死你的进程。

Are you pressing Ctrl+C (=interrupt) maybe? That will send a SIGINT, which will generally kill your process.

这篇关于Windows上的Java堆栈转储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆