这篇仅仅记录参数应用,大多数还是须要本人推敲
同时还须要保持
:)
jps
C:\Users\98du>jps -helpusage: jps [-help] jps [-q] [-mlvV] [<hostid>]Definitions: <hostid>: <hostname>[:<port>]C:\Users\98du>
参数阐明
-q : 过程id-m : 启动该过程所 输出执行的java 命令(不蕴含jvm参数)-l : 启动的jar文件名或者包类名-v : java过程启动参数(进jvm参数 不蕴含-m的输入)-V : 过程工具简写(默认该参数)hostid这个参数须要为hostname, 而不是ip
jmap
C:\Users\98du>jmap -hUsage: jmap [option] <pid> (to connect to running process) jmap [option] <executable <core> (to connect to a core file) jmap [option] [server_id@]<remote server IP or hostname> (to connect to remote debug server)where <option> is one of: <none> to print same info as Solaris pmap -heap to print java heap summary -histo[:live] to print histogram of java object heap; if the "live" suboption is specified, only count live objects -clstats to print class loader statistics -finalizerinfo to print information on objects awaiting finalization -dump:<dump-options> to dump java heap in hprof binary format dump-options: live dump only live objects; if not specified, all objects in the heap are dumped. format=b binary format file=<file> dump heap to <file> Example: jmap -dump:live,format=b,file=heap.bin <pid> -F force. Use with -dump:<dump-options> <pid> or -histo to force a heap dump or histogram when <pid> does not respond. The "live" suboption is not supported in this mode. -h | -help to print this help message -J<flag> to pass <flag> directly to the runtime systemC:\Users\98du>
参数阐明
-heap : 打印各过程的jvm参数配置, 同时会打印举荐配置-histo : 打印各个类的对象数及占用大小-histo:live : 只计算流动的对象-clstats : 打印class加载的类..?-finalizerinfo : 打印正在gc的类.?-dump示例C:\Users\98du>jmap -dump:format=b,file="D:\test\test-jmap\t.hprof" 18704Dumping heap to D:\test\test-jmap\t.hprof ...Heap dump file createdC:\Users\98du>
jstack
C:\Users\98du>jstack -hUsage: jstack [-l] <pid> (to connect to running process) jstack -F [-m] [-l] <pid> (to connect to a hung process) jstack [-m] [-l] <executable> <core> (to connect to a core file) jstack [-m] [-l] [server_id@]<remote server IP or hostname> (to connect to a remote debug server)Options: -F to force a thread dump. Use when jstack <pid> does not respond (process is hung) -m to print both java and native frames (mixed mode) -l long listing. Prints additional information about locks -h or -help to print this help messageC:\Users\98du>
jconsole(图形化操作)
命令行或者win+r
输出jconsole
即可
多看看吧, 兄die
首发链接