jstack -F如何影响正在运行的Java进程? [英] How does jstack -F affect a running Java process?

查看:589
本文介绍了jstack -F如何影响正在运行的Java进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试诊断我正在使用的Java Web应用程序(Jenkins)无响应的问题。如果我在没有 -F 标志的情况下运行 jstack 它不会给我任何东西,但如果我把旗帜放进去强制进行线程转储不仅我得到一个结果,而且应用程序开始响应并继续,好像什么也没发生,直到它最终再次停止响应。

I am trying to diagnose a problem where a Java web application I'm using (Jenkins) becomes unresponsive. If I run jstack without the -F flag it doesn't give me anything, but if I put the flag in to force a thread dump not only do I get a result, but the application starts responding and goes on as if nothing had happened until it eventually stops responding again.

什么 jstack -F 标志是否会影响正在运行的JVM并导致无响应的应用程序再次开始响应?

What does jstack -F flag do that would affect a running JVM and cause an unresponsive application to start responding again?

推荐答案

你可以看到jstack的来源这里。 -F参数更改jstack连接到jvm的方式。使用-F(或-m)JStack使用java调试器接口连接到jvm。如果指定了pid,则JStack将与 SA连接PID附加连接器,表示

You can see the source to jstack here. The -F argument changes how jstack connects to the jvm. With -F (or -m) JStack connects to the jvm using the java debugger interface. If a pid is specified, JStack connects with the SA PID Attaching Connector which says,


要调试的过程无需在debug
模式下启动(即,使用-agentlib:jdwp或-Xrunjdwp)。
流程允许挂起

我不知道为什么会导致无响应的应用程序再次开始响应,但上面的链接也说明了,

I don't know why it would cause an unresponsive application to start responding again, but the link above also says,


当此连接器连接时,该过程暂停,当
此连接器分离时,该过程将恢复。

The process is suspended when this connector attaches and resumed when this connector detaches.

这可能有效。

这篇关于jstack -F如何影响正在运行的Java进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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