Definitions: <option> An option reported by the -options option <vmid> Virtual Machine Identifier. A vmid takes the following form: <lvmid>[@<hostname>[:<port>]] Where <lvmid> is the local vm identifier for the target Java virtual machine, typically a process id; <hostname> is the name of the host running the target Java virtual machine; and <port> is the port number for the rmiregistry on the target host. See the jvmstat documentation for a more complete description of the Virtual Machine Identifier. <lines> Number of samples between header lines. 每隔多少行输出一次表头信息 <interval> Sampling interval. The following forms are allowed: <n>["ms"|"s"] Where <n> is an integer and the suffix specifies the units as milliseconds("ms") or seconds("s"). The default units are "ms". 指定输出统计数据的周期,可以是ms或者s,默认是ms <count> Number of samples to take before terminating. 指定查询的总次数 -J<flag> Pass <flag> directly to the runtime system.
jstat -gc 2713 S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 154816.0 154816.0 0.0 154816.0 1238656.0 1109939.1 2572288.0 218975.9 79812.0 77988.1 9928.0 9352.9 23 3.184 5 0.339 3.523
--- S0C 当前S0的容量K S1C 当前S1的容量K S0U S0的使用K S1U S1的使用K EC 当前eden的容量K EU eden的使用K OC 当前old的容量K OU old的使用K MC 元空间的容量K MU 元空间的使用K CCSC 压缩类空间大小 CCSU 压缩类空间使用大小 YGC young gc次数 YGCT young gc花费的时间 FGC full gc次数 FGCT full gc花费的时间 GCT 垃圾收集的总时间
Usage: jinfo [option] <pid> (to connect to running process) jinfo [option] <executable <core> (to connect to a core file) jinfo [option] [server_id@]<remote server IP or hostname> (to connect to remote debug server)
where <option> is one of: -flag <name> to print the value of the named VM flag 输出对应参数名的参数值 -flag [+|-]<name> to enable or disable the named VM flag 开启或关闭对应的参数,只有被标记为manageable的参数可以被实时修改 -flag <name>=<value> to set the named VM flag to the given value 设置对应名称的参数 -flags to print VM flags 输出全部的参数 -sysprops to print Java system properties 输出系统属性 <no option> to print both of the above 输出全部的参数和系统属性 -h | -help to print this help message
Usage: 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 输出整个堆空间的详细信息,包括使用哪种回收器、参数配置、分代状况等。 -histo[:live] pid查看堆内存中的对象数目、大小统计直方图,输出堆空间中对象的统计信息,包括类、实例数量和合计数量,如果加上live则只统计活对象 -clstats to print class loader statistics 以ClassLoader为统计口径输出内存状态信息 -finalizerinfo to print information on objects awaiting finalization 打印等待执行finalize方法的对象 -dump:<dump-options> to dump java heap in hprof binary format 生成dump文件 -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. 当虚拟机进程对-dump选项没有任何响应时,强制执行生成dump文件 -h | -help to print this help message -J<flag> to pass <flag> directly to the runtime system 传递参数给jmap启动的jvm
-J<flag> Pass <flag> directly to the runtime system. For example, -J-mx512m to use a maximum heap size of 512MB 传入启动参数 -stack false: Turn off tracking object allocation call stack. 关闭|打开对象分配调用栈跟踪 -refs false: Turn off tracking of references to objects 关闭|打开对象引用跟踪 -port <port>: Set the port for the HTTP server. Defaults to 7000 端口,默认7000 -exclude <file>: Specify a file that lists data members that should be excluded from the reachableFrom query. 执行对象查询时需要排除的数据成员 -baseline <file>: Specify a baseline object dump. Objects in both heap dumps with the same ID and same class will be marked as not being "new". 制定一个基准堆转储文件 -debug <int>: Set debug level. 设置debug级别 0: No debug output 1: Debug hprof file parsing 2: Debug hprof file parsing, no server -version Report version number 启动后显示版本信息就退出 -h|-help Print this help and exit <file> The file to read
For a dump file that contains multiple heap dumps, you may specify which dump in the file by appending "#<number>" to the file name, i.e. "foo.hprof#3".
Usage: 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 可以输出java堆栈信息,如果调用到本地方法的话,可以显示C/C++的堆栈 -l long listing. 除堆栈外,显示关于锁的附加信息 -h or -help 打印帮助信息
Usage: jcmd <pid | main class> <command ...|PerfCounter.print|-f file> or: jcmd -l or: jcmd -h command must be a valid jcmd command for the selected jvm. Use the command "help" to see which commands are available. If the pid is 0, commands will be sent to all Java processes. The main class argument will be used to match (either partially or fully) the class used to start Java. If no options are given, lists Java processes (same as -p). PerfCounter.print display the counters exposed by this process -f read and execute commands from the file -l list JVM processes on the local machine 列出所有的JVM线程 -h this help
java.lang.IllegalStateException: The platform metadata area could not be written: /private/var/folders/gn/d0l73l5d5wgdqc30m1pjkqp40000gn/T/AppTranslocation/B22F2288-7772-4327-9973-D41F1D0B2B7B/d/mat.app/Contents/MacOS/workspace/.metadata. By default the platform writes its content under the current working directory when the platform is launched. Use the -data parameter to specify a different content area for the platform