Java 线程跟踪调试

前几天,由于搞了安全加固,出现了一个性能性的问题,查看日志总找不出问题的所在,cpu一下飙升100%,但内存及数据库都显示无异常,纳闷了,后来发现还有这么一玩意,还真孤陋寡闻了,在JDK里面,伟大的SUN公司其实提供了一工具名字叫:jconsole,若配置了java环境变量,可以在命令行下直接输入jconsole,会弹出一分析框,它还可以跟踪远程java主机噢,这个是在windows环境下可查看java进程的工作状况,

在liunx下面,大家可以通过: kill -3 pid 这条命令, pid为java的线程号,然后通过查看日志,就可以发现刚才java线程刚才都在做什么,是不是很神奇 ,O(∩_∩)O~

已有1条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>