JDK工具-Jinfo命令
  • 2023-05-06 17:57:03
  • 702 热度
  • 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



alay

Flame

Hello world!

0 评论
留下评论