Common JVM command parameter parsing

  • -Xms20M
    sets the minimum heap size to 20M, which must be in M ​​units
  • -Xmx20M
    sets the maximum heap size to 20M, which must be in M ​​units. Set -Xmx and -Xms the same to avoid heap auto-expansion. For large projects -Xmx and -Xms are generally set to 15G, 25G or even higher.

  • -verbose:gc

    Output the details of the GC in the virtual machine.

  • -Xss256k
    sets the size of the virtual machine stack to 256k.

  • -Xoss128k
    sets the size of the native method stack to 128k. However, HotSpot does not distinguish between the virtual machine stack and the native method stack, so this parameter is invalid for HotSpot

  • -XX:PermSize=64M

    The capacity of the permanent generation initially allocated by the JVM must be in M ​​units. In most cases, this parameter defaults to 64M.

  • -Xnoclassgc
    turns off JVM garbage collection of classes.

  • -XX:+TraceClassLoading
    View class loading information.

  • -XX:+TraceClassUnLoading

    View unloading information for a class.

  • -XX:NewRatio=4
    sets the ratio of young generation: old generation to 1:4, which means that the young generation occupies 1/5 of the entire heap.

  • -XX:SurvivorRatio=8

    Set the size ratio of 2 Survivor areas: 1 Eden area to 2:8, which means that the Survivor area occupies 1/5 of the entire young generation. This parameter defaults to 8.

  • -Xmn30M

    Set the size of the young generation to 20M.

  • -XX:+HeapDumpOnOutOfMemoryError
    allows the virtual machine to dump the current heap memory dump snapshot when a memory overflow exception occurs.

  • -XX:+UseG1GC

    Let the JVM use the G1 garbage collector.

  • -XX:+PrintGCDetails

    Print out GC specific details on the console.

  • -XX:+PrintGC
    Prints GC information on the console.

  • -XX:PretenureSizeThreshold=5242880

    Indicates that when the object is larger than 5242880 (5M), it directly enters the old generation allocation, which can only be used in bytes.

  • -XX:MaxTenuringThreshold=2
    means that the age of the object is greater than 1, and it automatically enters the old age.

  • -XX:CompileThreshold=600

    Indicates that after a method is called 600 times, it will be considered hot code and trigger just-in-time compilation.

  • -XX:+PrintHeapAtGC
    can see the heap memory layout before and after each GC.

  • -XX:+PrintTLAB
    means you can see the usage of TLAB.

  • -XX:+UseSpining enables
    spinlock.

  • -XX:PreBlockSpin
    changes the spin times of the spin lock. To use this parameter, the spin lock must be enabled first.

Sorry for any inaccuracies.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325860084&siteId=291194637