File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant build - OutOfMemoryError in eclipse

 
Ramesh Kumar Swarnkar
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Added this recipe to my notebook, thank you.
 
Ramesh Kumar Swarnkar
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter, thanks for your input.
It really helped me to resolve this. It works now thankx.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic