JPS viewing the PID of a Java processjava-xx:+printflagsinitial display all configurable parameters and default valuesjava-xx:+printflagsfinal gets all the parameters and values that can be set (manually set values)java-xx:+printcommandlineflags shows all parameters and their values that are different from the original default values after the JVM is initializedJmap-histo [PID] View the distribution of objects on the Java heap Java usage: Java [-options] class [args ...] (execution Class) or Java [-options]-jar jarfile [args ...] (Execute JAR file) For example: JAVA-CP. -xmx3g-xmn2g-server-xx:-tieredcompilation appmain[-options] -D32 using 32-bit data model (if available) -D64 using 6 4-bit data model (if available) -server Select "Server" VM, default VM is server -CP < directory and Zip/jar file class search path > &nbs P -classpath < directory and the class search path of the Zip/jar file, using: Delimited directory, jar and zip list, for searching class files. -d< name >=< value > Set System Properties -verbose:[class|gc|jni] enable verbose output - Version output product version and exit -showversion output product version and continue -XDIAG Show additional diagnostic messages -XNOCLASSGC Disable class garbage collection -XINCGC enable incremental garbage collection -xloggc:<file> record GC status in file (with timestamp) -xbatch disable background compilation &N Bsp -xms<size> Setting the initial Java heap size -xmx<size> Setting the maximum Java heap size -xss<size> Setting the Java thread stack size &NB Sp -XPROF output CPU profile data -xshowSettings Show all settings and continue -xshowsettings:all Show all settings and continue -XSHOWSETTINGS:VM Show all VM-related settings and continue -xshowsettings:properties Show all property settings and continue -xshowsettings:locale Show all locale-related settings and continue -xx:-usebiasedlocking off bias lock defaults to lightweight lock status -xx:-doescapeanalysis close Escape analysis -xx:-tieredcompilation Turn off layered compilation -XX:-BackgroundCompilation turn off asynchronous compilation -XX:CompileThreshold the number of method calls or cycles reached this threshold will trigger the standard compilation (client:1500,server:10000) PS:
Threshold calculation that triggers OSR compilation (OSR compilation is the other way to compile the loop code without compiling the class)
-xx:compilethreshold = 10000
-xx:onstackreplacepercentage = 140
-xx:interpreterprofilepercentage = 33
OSR trigger = (Compilethreshold * (onstackreplacepercentage-interpreterprofilepercentage))/100 = 10700
JIT compilation is done asynchronously by default, when the optimization of a method or a block of code is triggered, it is put into the compilation queue and compiled by the compiled thread, and the compiled code is placed in the Codecache, and the size of the Codecache is limited. Compilethreshold is set too low, JIT compiles a bunch of less-frequent code and puts it into Codecache, causing the code to actually execute frequently without enough space to store it.
Java Common commands