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 which is 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 night not suffice for the bigger ones.
Below is a sample
-startup plugins/org.eclipse.equinox.launcher_1.5.300.v20190213-1655.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1000.v20190125-2016 -product org.eclipse.epp.package.jee.product -showsplash org.eclipse.epp.package.common --launcher.defaultAction openFile --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.8 -Dosgi.email@example.com/eclipse-workspace -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=1.8 -Dosgi.dataAreaRequiresExplicitInit=true -Xms256m -Xmx1024m --add-modules=ALL-SYSTEM
Fixing the problem means allocating more memory for
Eclipse. This could be done by increasing the values these parameters in the configuration file where the numbers represent the amount of memory to be allocated in megabytes (MB):
|Initial memory allocation pool|
|Maximum memory allocation pool for Java Virtual Machine (JVM)|
There's no magic number for the memory allocation as it depends on how big is your project and how much memory your system have. You can start by probably doubling the amounts as in the below example and then go from there such as in below example:
The changes will take effect after
Eclipse is restarted.