java jinfo_jinfo 查看、设置JVM参数

用法:

# jinfo -h

Usage:

jinfo [option]

(to connect to running process)

jinfo [option]

(to connect to a core file)

jinfo [option] [[email protected]]

(to connect to remote debug server)

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

-flags to print VM flags

-sysprops to print Java system properties

to print both of the above

-h | -help to print this help message

例子:

$ jinfo -flag HeapDumpBeforeFullGC 29167 #查看HeapDumpBeforeFullGC

-XX:-HeapDumpBeforeFullGC

$ jinfo -flag +HeapDumpBeforeFullGC 29167 #打开HeapDumpBeforeFullGC

$ jinfo -flag HeapDumpBeforeFullGC 29167

-XX:+HeapDumpBeforeFullGC

$ jinfo -flag -HeapDumpBeforeFullGC 29167 #关闭HeapDumpBeforeFullGC

$ jinfo -flag HeapDumpBeforeFullGC 29167

-XX:-HeapDumpBeforeFullGC

如果出现:

pid: well-known file is not secure

请确认当前执行jinfo的命令的用户有 /tmp/hsperfdata_$USER/$PID 文件的权限

如果出现:

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

at sun.tools.attach.LinuxVirtualMachine.execute(LinuxVirtualMachine.java:218)

at sun.tools.attach.HotSpotVirtualMachine.executeCommand(HotSpotVirtualMachine.java:213)

at sun.tools.attach.HotSpotVirtualMachine.setFlag(HotSpotVirtualMachine.java:190)

at sun.tools.jinfo.JInfo.flag(JInfo.java:123)

at sun.tools.jinfo.JInfo.main(JInfo.java:76)

说明参数不支持修改

另外,jinfo可能在未来的jvm中移除。

参考资料:

已有 0 人发表留言,猛击->> 这里<

ITeye推荐

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值