jinfo Java配置資訊工具

  • 2019 年 10 月 6 日
  • 筆記

jinfo(Configuration info for Java)

  jinfo的作用是實時地查看和調整虛擬機各項參數。

jinfo 命令格式:

jinfo [ option ] pid

pid是虛擬機進程ID(用jps可以查詢)

option 列表:

選項

說明

-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

-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

  jinfo 還可以使用 -sysprops 選項把虛擬機進程的 System.getProperties() 的內容列印出來。在運行期修改參數使用-flag[+|-] name 或者 -flage name=value 修改一部分運行期可寫的虛擬機參數值。