Intellij IDEA Run Configuration configures VM options parameters

For example, fill in VM options:

 -Xms512m -Xmx512m -XX:PermSize=64M -XX:MaxPermSize=256m 

Each item is separated by a space.

Parameter description
-Xms768m: Set the JVM initial heap memory to 768m. This value can be set the same as -Xmx to avoid the JVM reallocating memory after each garbage collection is complete.
-Xmx768m: Set the JVM maximum heap memory to 768m.
-Xss128k: Set the stack size of each thread. After JDK5.0, each thread stack size is 1M, and before each thread stack size is 256K. It should be adjusted according to the memory size of the application thread. Under the same physical memory, reducing this value can generate more threads. However, the operating system still has a limit on the number of threads in a process, which cannot be generated indefinitely, and the experience value is about 3000 ~ 5000. It should be noted that when this value is set larger (for example,> 2MB), it will greatly reduce the performance of the system.
-Xmn2g: Set the young generation size to 2G. Given the size of the entire heap memory, increasing the young generation will reduce the old generation and vice versa. This value is related to JVM garbage collection and has a great impact on system performance. The official recommended configuration is 3/8 of the entire heap size.
-XX: NewSize = 1024m: Set the initial value of the young generation to 1024M.
-XX: MaxNewSize = 1024m: Set the maximum value of the young generation to 1024M.
-XX: PermSize = 256m: Set the initial value of persistent generation to 256M.
-XX: MaxPermSize = 256m: Set the maximum value of the persistent generation to 256M.
-XX: NewRatio = 4: Set the ratio of the young generation (including 1 Eden and 2 Survivor areas) to the old generation. It means that the young generation is 1: 4 compared to the old generation.
-XX: SurvivorRatio = 4: Set the ratio of Eden area to Survivor area in the young generation. It means that the ratio of two Survivor areas (the JVM heap memory young generation has two Survivor areas of equal size by default) to one Eden area is 2: 4, that is, one Survivor area accounts for 1/6 of the entire young generation size.
-XX: MaxTenuringThreshold = 7: If an object has moved 7 times in the Survivor area (rescue space) and has not been garbage collected, it will enter the old generation. If it is set to 0, the young generation object does not pass through the Survivor area and enters the old generation directly. For applications that require a large amount of resident memory, this can improve efficiency. If you set this value to a larger value, the young generation object will be copied multiple times in the Survivor area, which can increase the survival time of the object in the young generation, increase the probability of the object being garbage collected in the young generation, and reduce the frequency of Full GC , This can improve service stability to some extent.

Standard parameters. All JVMs must support the functions of these parameters and be backward compatible; for example:

-client——Set the JVM to use the Client mode, which is characterized by a relatively fast startup speed, but low runtime performance and memory management efficiency. It is usually used for client applications or development and debugging; directly running Java programs in a 32-bit environment is enabled by default The model.
-server——Set the JVM to enable the Server mode, which is characterized by a relatively slow startup speed, but high performance and memory management efficiency at runtime, which is suitable for production environments. This mode is enabled by default in a JDK environment with 64-bit capabilities.
Non-standard parameters (-X), the default JVM implements the functions of these parameters, but does not guarantee that all JVM implementations are satisfied, and does not guarantee backward compatibility;
non-stable parameters (-XX), such parameters will be different for each JVM implementation Different, it may not be supported in the future and needs to be used with caution;

Guess you like

Origin www.cnblogs.com/zsg88/p/12744581.html