如何获得Jetty线程转储?

编程入门 行业动态 更新时间:2024-10-23 20:19:56
本文介绍了如何获得Jetty线程转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 Ubuntu Server 10.10 64位,它在 Sun的JVM 上的 Jetty 6.1.24-6 上运行了Web应用程序来自标准Ubuntu存储库.

I have a Ubuntu Server 10.10 64-bit running a web application on Jetty 6.1.24-6 on Sun's JVM, both installed from standard Ubuntu repositories.

我正在尝试查找此服务器的问题(一段时间后100%cpu,这可能与NIO的Selector上的一个已知错误有关,尽管看起来好像将连接器更改为旧io SocketConnector并没有解决问题!),并且需要进行线程转储.

I'm trying to track down a problem with this server (100% cpu after some time, it might be related to a known bug on NIO's Selector, although it looks like changing the connector to old io SocketConnector didn't solve the problem!), and need to take a thread dump.

不幸的是,我无法获取线程转储.我尝试向该过程发送 SIGQUIT ,并尝试将 JStack 附加到该过程,但是两种方法均无效.

Unfortunately I'm unable to get the thread dump. I've tried to send a SIGQUIT to the process, and tried to attach JStack to it, but neither approach works.

我从SIGQUIT(在Jetty生成的任何日志文件中)根本看不到任何输出,即使以root(或jetty)身份运行并带有"-F",JStack也表示它已附加到处理,但随后阻塞并不再产生输出!

I see no output at all from SIGQUIT (in any of the log files generated by Jetty), and JStack, even when run as root (or jetty) and with "-F", says that it has been attached to the process, but then blocks and produces no more output!

如何获取线程转储?

推荐答案

您必须以正在运行码头程序的同一用户身份执行此操作.在Ubuntu上,此用户通常称为jetty.

You have to do this as the same user as the jetty process is running under. On Ubuntu this user is normally called jetty.

所以尝试

sudo -u jetty jstack <pid>

这会将线程转储发送到stdout(您的shell).

this will send a thread dump to stdout (your shell).

您也可以

sudo -u jetty kill -QUIT <pid>

这会将线程转储发送到码头的标准输出(通常为/var/log/jetty/out.log)

which will send the thread dump to jetty's stdout (normally /var/log/jetty/out.log)

要获取pid,请使用jps命令或ps ax|grep java

To get the pids use the jps command or ps ax|grep java

更多推荐

如何获得Jetty线程转储?

本文发布于:2023-10-26 19:03:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531072.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线程   如何获得   Jetty

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!