查看JVM参数的工具 jinfo
[root@xtpt-cs-app ~]# jinfo -help
Usage:
jinfo [option] <pid>
(to connect to running process)
jinfo [option] <executable <core>
(to connect to a core file)
jinfo [option] [server_id@]<remote server IP or hostname>
(to connect to remote debug server)
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
-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
- no option 输出全部的参数和系统属性
- -flag name 输出对应名称的参数
- -flag [+|-]name 开启或者关闭对应名称的参数
- -flag name=value 设定对应名称的参数
- -flags 输出全部的参数
- -sysprops 输出系统属性
比如说查看某个VM参数变量值
[root@xtpt-cs-app ~]# jinfo -flag ThreadStackSize 23678
-XX:ThreadStackSize=512
XX:ThreadStackSize 每个线程堆栈的大小,默认值1024K,当发生网络密集实践时建议优化该参数,线上环境大小为 512K