java程序!

来源:互联网 发布:淘宝6s特价1380能买吗 编辑:程序博客网 时间:2024/06/16 14:35

  1.jps:查看当前运行着的java进程(仿linux下的ps),显示进程号

  2. jinfo: 查参数jinfo -flagPermSize 2208(进程号)

  jinfo -flag MaxPermSize 2208(进程号)

  C:\Users\WILL>jinfo

  Usage:

  jinfo

  (to connect to a running process)

  where is one of:

  -flag to print the value of the named VM flag

  -flag [+|-] to enable or disable the named VM flag

  -flag = to set the named VM flag to the given value

  -h | -help to print this help message

  3. jconsole 2208

  用法:

  jconsole [ -interval=n ] [ -notile ] [ -pluginpath ] [ -version ] [ connection …]

  -interval 将更新间隔时间设置为 n 秒(默认值为 4 秒)

  -notile 最初不平铺显示窗口(对于两个或更多连接)

  -pluginpath 指定 jconsole 用于查找插件的路径

  -version 输出程序版本

  connection = pid || host:port || JMX URL (service:jmx:://…)

  pid 目标进程的进程 ID

  host 远程主机名或 IP 地址

  port 用于远程连接的端口号

  -J 对正在运行 jconsole 的 Java 虚拟机指定

  输入参数

  4. jstack 2208列出所有线程,以及线程的运行状态

  C:\Users\WILL>jstack

  Usage:

  jstack [-l]

  (to connect to running process)

  Options:

  -l long listing. Prints additional information about locks

  -h or -help to print this help message

  5. jstat -gcutil 2208 1000(每隔1000毫秒打印一次信息) 10(打印10行)

  C:\Users\WILL>jstat

  invalid argument count

  Usage: jstat -help|-options

  jstat - [-t] [-h] [ []]

  Definitions:

   An option reported by the -options option

   Virtual Machine Identifier. A vmid takes the following form:

  [@[:]]

  Where is the local vm identifier for the target

  Java virtual machine, typically a process id; is

  the name of the host running the target Java virtual machine;

  and 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.

   Number of samples between header lines.

   Sampling interval. The following forms are allowed:

  ["ms"|"s"]

  Where is an integer and the suffix specifies the units as

  milliseconds("ms") or seconds("s")。 The default units are "ms".

   Number of samples to take before terminating.

  -J Pass directly to the runtime system.

  C:\Users\WILL>jstat -options

  -class

  -compiler

  -gc

  -gccapacity

  -gccause

  -gcnew

  -gcnewcapacity

  -gcold

  -gcoldcapacity

  -gcpermcapacity

  -gcutil

  -printcompilation

0 0
原创粉丝点击