This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes java.lang.OutOfMemoryError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "java.lang.OutOfMemoryError" Watch "java.lang.OutOfMemoryError" New topic
Author

java.lang.OutOfMemoryError

Anand Srinivas
Greenhorn

Joined: Dec 30, 2003
Posts: 8
Hi,
I am new to ANT and while trying to build an application by giving the ant command in the prompt, I am getting an error stating the System is out of resources and it shows java.lang.OutOfMemoryError. Can somebody please explain me why this is happening and how to correct it?

Thanks,
Anand Srinivas
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What specific target gives you an OutOfMemoryException? Some like javac and javadoc can eat a lot of memory; you might check out the possibility of forking a new jvm for these tasks and allocating more memory to them (see the docs). You might also look out for too many <ant /> and <antcall /> tasks, both are inefficient, since they require reparsing the build file, plus creating seperate instances of Ant's ClassLoader and all Project properties.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
One another issue can be with the Windows ME or 98 editions. If you get this error with simple ant build as well then probably you must increase the size of the command environment.

Windows Explorer -> %ANT_HOME%\bin\ant.bat -> right click > select memory tab > try to increase the size of "Initial environment"
Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
Set ANT_OPTS with memory switches. E.g., -Xmx512m
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.OutOfMemoryError
 
Similar Threads
How Do I Find a Memory Leak?
OutOfMemoryError in Accessing CICS Transaction from JAVA in WebSphere 3.5
Out of MemoryError
java.lang.OutOfMemoryError
exception & loop