Today, when eclipse was restarted after the update, it was quite puzzling that eclipse encountered a problem.
Click the error message "error occurred during initialization of VM cocould not reserve enough space for object Heap" displayed on the console ".
The reason is:
When eclipse is started, the memory allocated to the Java Virtual Machine (JVM) is greater than the number of available memory in the system. Therefore, there is not enough space allocated to the JVM to create objects.
If 98% of the time in JVM is used for GC and is available, this exception is thrown when the heap size is less than 2%. JVM heap setting refers to the setting of memory space that JVM can allocate during Java program running.
Solution:
Modify the parameters in eclipse. ini in the eclipse Directory:-XMS-xmx, and assign appropriate values to them.
The rules are as follows: the JVM automatically sets the heap size value at startup. The initial space (-XMS) is 1/64 of the physical memory, and the maximum space (-xmx) it is 1/4 of the physical memory. You can use options such as-xmn-XMS-xmx provided by JVM to set the configuration. The heap size should not exceed 80% of the available physical memory. Generally, the-XMS and-xmx options must be set to the same, and-xmn is the-xmx value of 1/4.
Example (my eclipse. INI)
-Showsplash
Org. Eclipse. Platform
-Launcher. xxmaxpermsize
256 m
-Vmargs
-Dosgi. requiredjavaversion = 1.5
-Xms40m
-Xmx256m
This makes it easy to solve the problem ............