Eclipse error ("cocould not reserve enough space for object Heap ")

Source: Internet
Author: User
Tags xms

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 ............

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.