使用java自带工具监控jvm运行状态
作者:网络转载 发布时间:[ 2014/3/24 10:33:39 ] 推荐标签:java 监控 jvm
1.jps:查看当前运行着的java进程(仿linux下的ps),显示进程号
2. jinfo: 查参数jinfo -flagPermSize 2208(进程号)
jinfo -flag MaxPermSize 2208(进程号)
C:UsersWILL>jinfo
Usage:
jinfo <option> <pid>
(to connect to a running process)
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
-flag <name>=<value> 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 <path> ] [ -version ] [ connection ...]
-interval 将更新间隔时间设置为 n 秒(默认值为 4 秒)
-notile 初不平铺显示窗口(对于两个或更多连接)
-pluginpath 指定 jconsole 用于查找插件的路径
-version 输出程序版本
connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)
pid 目标进程的进程 ID
host 远程主机名或 IP 地址
port 用于远程连接的端口号
-J 对正在运行 jconsole 的 Java 虚拟机指定
输入参数
4. jstack 2208列出所有线程,以及线程的运行状态
C:UsersWILL>jstack
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

sales@spasvo.com