aspose file tools*
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
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: 3479

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: 5830
    
    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: 3479

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: 5830
    
    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!
 
Don't get me started about those stupid light bulbs.
 
subject: Ant build - OutOfMemoryError in eclipse