This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant build - OutOfMemoryError in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant build - OutOfMemoryError in eclipse" Watch "Ant build - OutOfMemoryError in eclipse" New topic
Author

Ant build - OutOfMemoryError in eclipse

Ramesh Kumar Swarnkar
Ranch Hand

Joined: Sep 15, 2003
Posts: 84
I get 'outofmemoryError:java heap size' while running ant build in eclipse.
As a work around, I have set the ANT_OPT in environment tab of eclipse JRE and "-Xms40m -Xmx512m" for VM in eclipse, but still I get OutOfMemoryError.
Please help.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Eclipse isn't running of memory, it is Ant. You need to set its options within Eclipse (I don't know where exactly, I don't use Eclipse but it should be easy).
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

First, you have to find out whether Ant is running inside Eclipse (within the same JVM), or if it running outside of Eclipse (in a separate JVM). If you don't know, there are two things you can try:

a) Run Ant from a command prompt. Make sure you set the ANT_OPTS. If that works, most likely you were running Ant within Eclipse. If that doesn't work (still get an OOME), then your heap size is still too small.

b) Change the heap size for Eclipse. To do this, edit the eclipse.ini file and change the existing settings. If that works, then Ant is running within Eclipse.


JBoss In Action
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Added this recipe to my notebook, thank you.
Ramesh Kumar Swarnkar
Ranch Hand

Joined: Sep 15, 2003
Posts: 84
Hi Peter, thanks for your input.
It really helped me to resolve this. It works now thankx.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Ramesh, I'm glad that you got things running, but would you please describe exactly what you did to fix your problem? Such information will be helpful to the next persons that has the same issue and comes across this post. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant build - OutOfMemoryError in eclipse
 
Similar Threads
Eclipse with Ant
Java heap space error with jdk 160_11 but no errors in 160_25
xdoclet plugin for eclipse - configuring xdoclet
java.lang.OutOfMemoryError
out of memory on ant build - upping Xmx isn't working