jinfo monitoring tool of the JVM

Reference blog: https://www.jianshu.com/p/8d8aef212b25

Role jinfo (ConfigurationInfoforJava) is a real-time view and adjust the parameters of the virtual machine, jps command using the -v parameter can be viewed when the virtual machine starts explicitly specified parameter list.
But if you want to know the default value is not explicitly specified parameters, in addition to look for information, but you can only use the -flag option jinfo query.

  • no option outputs of all system parameters and properties
  • -flag name corresponding to the output parameter name
  • -flag [+ | -] name on or off corresponding to the parameter name

We can modify parameters in real time by jinfo virtual machine, but not any command can be modified, you can modify the parameters we first execute this command: java -XX: + PrintFlagsFinal -version, will list all the parameters supported by the current machine, so what jinfo can modify the parameters of what is it?

Only the last one is displayed in this column to be modified manageable.

Carefully review found modifiable parameters is not much, jvm memory to run once finalized at run time, then it can not be modified. However, some errors can not record information is not, or is turned off, or can be modified

 

For example, we query the idea of ​​whether to open a detailed print process GC log information, we can execute this command: jinfo -flag PrintGCDetails 17312, from the results we can see that there is no printed GC details open.

jinfo can also use -sysprops options to the virtual machine process System.getProperties () to print out the contents, you can execute the command: jinfo -sysprops 17312.

 

jinfo -flags: will print all the relevant parameters of the current thread, for example, we want to print all the relevant parameters idea of ​​this process, we have to execute the command: jinfo -flags 40416 lists the JVM version displays the current idea of ​​his non-ischemic the savings value (that is, your modified), as well as representatives of the command line is passed as a command line parameter for some idea of ​​this process

 

 Check the maximum heap memory jinfo -flag MaxHeapSize 17312 

 

View garbage collector used
jinfo -flag UseConcMarkSweepGC 17312

jinfo -flag UseG1GC 17312
jinfo -flag UseParallelGC 17312

 

It can be seen garbage collector used is ParallelGC

 

Guess you like

Origin www.cnblogs.com/cheng21553516/p/11223601.html