Eclipse will throw the below error when it runs out of memory. It normally occurs when performing memory-hungry operations on big projects such as building the project's workspace.

An internal error occurred during: "Building workspace".
GC overhead limit exceeded

Memory is allocated via Eclipse' configuration file, read and executed during Eclipse' startup. It is located in its installation directory and named eclipse.ini. The default values are good enough for small projects but might not suffice for the bigger ones.

Below is a sample 'eclipse.ini file;


Fixing the problem means allocating more memory for Eclipse. This could be done by increasing the values of these parameters in the configuration file where the numbers represent the amount of memory to be allocated in megabytes (MB):

Item Description
XmsInitial memory allocation pool
XmxMaximum memory allocation pool for Java Virtual Machine (JVM)

There's no magic number for the memory allocation as it depends on how big your project is and how much memory your system has. You can start by doubling the amounts as in the below example and then go from there, such as in the below example:


The changes will take effect after Eclipse is restarted.

Discuss the article:

Comment anonymously. Login not required.