• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.OutOfMemoryError

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
 
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Set ANT_OPTS with memory switches. E.g., -Xmx512m
 
Let's go to the waterfront with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic