Table of Contents
Eclipse Out of Memory Error happens when you are working on large projects. Sometimes it's because of Permgen space (below Java 8) and sometimes your eclipse memory runs out of heap memory.
Eclipse OutOfMemoryError Fix
We can increase eclipse memory by providing more Permgen space and heap memory for Eclipse to use. These settings are usually configured in the eclipse.ini file. You can check the location of the eclipse.ini file from below images for Mac OS X. !eclipse out of memory, eclipse memory !eclipse.ini file, eclipse.ini file location mac In windows, you will find the eclipse.ini file in the same directory as the eclipse.exe file. !eclipse.ini file location windows 10 Once you have located the eclipse.ini file, just open it in your favorite text editor.
Increase Eclipse Heap Space
You can increase the maximum heap size by editing -Xmx value. For example, below snippet will increase the eclipse heap size to 2 GB.
-Xmx2048m
Increase Permgen Space in Eclipse
If you are using below [Java 8](/community/tutorials/java-8-features-with-examples), then you might get OutOfMemoryError: Permgen space, just increase the permanent generation space available to Eclipse. Below is the configuration to increase permgen space to 512 MB in eclipse.ini file.
-XX:MaxPermSize=512M