Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse runs out of heap space on ant build

ext-Myself and two co-workers have been working on a GWT project and coding in eclipse. The project is growing and we are bringing on several new developers to help out. I have been tasked with setting up their workstations before they start work. Our current systems all worked out of the box following the basic GWT set up guide (http://code.google.com/webtoolkit/usingeclipse.html)

On my working system I have not changed any of the defaults that eclipse has set for memory size.

The new system will run the simple starter projects, so I know that I have GWT set up. When I import our current code base I can run the site locally without issue. When I try and run the ant script that we have to build our project and push it out to our dev server the new system complains:

Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded

On the new system I have modified the eclipse.ini file to and set -Xmx1024M and I have added -Xmx1024M under Window>Preferences>Java>Installed JREs neither of which have solved the problem. (shown here: http://dinu.blog.com/2010/06/02/out-of-memory/)

I have tried 32 and 64 bit versions of eclipse, and I have even tried just copying my known working eclipse folder onto the new system without any luck. Does anyone have any ideas?

like image 711
Jodosh Avatar asked Feb 16 '12 16:02

Jodosh


People also ask

How do I fix heap memory in eclipse?

Temporary fix – Increase the heap size On the Eclipse menu, clicks Run -> Run Configurations.. , select the Java application we want to run, click on the Arguments tab, VM arguments section, and adjust a better Java initial maximum heap size.

How do I resolve out of memory exception in eclipse?

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.

How do I fix Java out of memory error heap space?

OutOfMemoryError: Java heap space. 1) An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options "-Xmx512M", this will immediately solve your OutOfMemoryError.


2 Answers

Likely you need to increase the memory for the JVM running ant (via eclipse's external tools preferences) as described here: http://soenkerohde.com/2008/06/change-eclipse-ant-settings-when-you-run-out-of-memory/

like image 151
nirmal Avatar answered Oct 06 '22 05:10

nirmal


We have similar issues when running certain Ant scripts. You can set VM arguments for the Ant Build in the Run->External Tools->External Tools Configurations dialog. Click the JRE tab and set the usual -Xmx and -Xms params as needed.

like image 20
Tony Avatar answered Oct 06 '22 05:10

Tony