Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.OutOfMemoryError

 
Anand Srinivas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set ANT_OPTS with memory switches. E.g., -Xmx512m
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic