网站首页
Java
站长
开源
框架
理论
JS
Linux
DB
服务器
NET
生活
软件
PHP
其他
您的位置:首页 > 理论 > JDK工具-Jinfo命令
JDK工具-Jinfo命令
2015-7-31    10532    0

Jinfo是JDK自带Java配置信息工具。位于java的bin目录下,jinfo的作用是实时地查看和调整虚拟机的各项参数,虽然使用Jps命令的-v参数可以查看虚拟机启动时显示指定的参数列表。但是如果想要知道没有被明确指出的系统默认值,就需要用到jinfo。


Jinfo还能够修改一部分运行期间能够调整的虚拟机参数。


1、Jinfo命令格式

jinfo [ option ] pid

2、常用参数

Usage:

jinfo <option> <pid>

(to connect to a running process)

where<option> is one of:

-flag <name> to print the value of the named VMflag

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

-flag <name>=<value> to set thenamed VM flag to the given value

-h | -help to print this help message


首先要用JPS找到对应的进程ID

jps -v


然后执行jinfo

jinfo -flag SurvivorRatio 26036

注意:很多运行参数是不能调整的,如果出现这种异常,说明不能调整:

jinfo -flag -XX:SurvivorRatio=9 26036

报错:

Exception in thread "main" java.io.IOException:Command failed in target VM


上一篇: JDK工具-JPS命令
下一篇: JDK工具-javap命令
发表评论:
您的网名:
个人主页:
编辑内容: