Jstack:获取java的线程情况,jdk1.5/1.6都可使用。使用方法:

Usage:
    jstack [-l] <pid>
        (to connect to running process)

Options:
    -l  long listing. Prints additional information about locks
    -h or -help to print this help message

 

Jmap:获取java更详细信息,包含Jstack能获取到的线程情况,但只有JDK1.6及以上的应用可以用。使用方法:

Usage:
    jmap -histo <pid>
      (to connect to running process and print histogram of java object heap
    jmap -dump:<dump-options> <pid>
      (to connect to running process and dump java heap)

    dump-options:
      format=b     binary default
      file=<file>  dump heap to <file>

    Example:       jmap -dump:format=b,file=heap.bin <pid>

 

Jconsole::java监视和管理控制台,jdk1.5及以后版本可用。可实现监控本地及远程java应用。

              Tomcat中启用远程Jconsole方法:

              catalina.bat:

set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port="9004" -Dcom.sun.management.jmxremote.authenticate="false" -Dcom.sun.management.jmxremote.ssl="false"

              catalina.sh:

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

posted on 2014-01-14 13:46  BrightMi  阅读(419)  评论(0)    收藏  举报