Eclipse OutOfMemory Error Fix by increasing Heap Memory/Permgen Space

Filed Under: Java

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 eclipse memory size windows

Increase Permgen Space in Eclipse

If you are using below Java 8, 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

Comments

  1. Kandy says:

    It worked very well. Thank you.

  2. jakeer says:

    Worked for me …Thank you.

  3. Buster McGibbons says:

    Not helpful at all. Most people use Windows these days.

    1. Pankaj says:

      I have already mentioned that in Windows eclipse.ini file is at the same location as the eclipse.exe file. I have also added an image now for more clarity.

  4. Aradhana says:

    Hello

    I am getting an internal error while launching the eclipse saying “java heap space ” during setup check.
    Please help me!

  5. Joe D. says:

    Worked for me on OSX High Sierra using Eclipse Oxygen. Thanks

  6. Rohit says:

    Hello …

    I have an issue, My spring tool suite hangs (not responding) after using it for 5 mins and this happens when I start my server on which our application is hosted . Please help me out

    1. Pankaj says:

      Increase eclipse memory by editing eclipse.ini file, or use a separate server that is not embedded in eclipse.

  7. HARSHA VARDHAN says:

    An internal error occurred during: “Retrieving archetypes:”.
    GC overhead limit exceeded

    please help me to solve this

  8. Sana Shaikh says:

    thnks alot sir….really helpful

  9. sathya says:

    I am a regular reader of your blog. the blog is very interesting and will be much useful for us.

Leave a Reply

Your email address will not be published. Required fields are marked *

close
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages