Java interview questions --JVM (2)

Title: You said you did JVM tuning and parameter configuration, check to see how the system default JVM

JVM arguments type

Standard parameters

-version
-help
java -showversion

X parameters (understand)

-Xint: interpreted
-Xcomp: first time compiled to native code
-Xmixed: Mixed Mode
Here Insert Picture Description

XX parameters (focus)

Boolean type

Formula: -XX: + or - a property value (+ indicates enabled, - disabled)
Example:
whether to print the GC to collect details:
Here Insert Picture Description

KV setting type

Formula: -XX: key = attribute value attribute value
Examples: modify meta-space
The default meta-space
Here Insert Picture Description

-XX: MaxTenuringThreshold = 15 default rose 15 times from the young old

How to view inventory system default JVM

The first parameter View

FirstlyjpsView the process ID, then usejinfo -flag process configuration item numberCheck the configuration currently running program.

jinfo -flags process IDView all default parameters

The second view the JVM defaults

java -XX:+PrintFlagsInitialThe main view the default initial value
java -XX:+PrintFlagsFinalThe main view modify update
java -XX:+PrintCommandLineFlagsPrint command-line parameters

Colon equal sign: artificially modifying parameters or loading different modified jvm

Hang question: Classic two parameters: -Xms and -Xmx

-Xms: equivalent to -XX: initialHeapSize heap memory initialization
-Xmx: equivalent to -XX: MaxHeapSize maximum heap memory

Default initial value

The default initial memory computer memory is 1/4 of
the initial heap size for the computer memory of 1/64

Published 18 original articles · won praise 0 · Views 426

Guess you like

Origin blog.csdn.net/qq_33805483/article/details/104104635