wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant - Try to increase heap size error 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 - Try to increase heap size error" Watch "Ant - Try to increase heap size error" New topic
Author

Ant - Try to increase heap size error

Peter Warde
Ranch Hand

Joined: Aug 18, 2004
Posts: 71
Hi

I'm getting the following error message in Ant when I build.
Can anybody explain why I am running out of memory after a number of builds and how I can fix (re-booting of course fixes it, but's a drag)

Thanks

Peter



null
ParameterImpl instances: 0
MethodImpl instances: 0
ConstructorImpl instances: 0
SimpleNode instances: 0
SourceClass instances: 0
XDoc instances: 0
DefaultXTag instances: 0
BinaryClass instances: 0
UnknownClass instances: 0
Total memory: 155
Free memory: 94
Try to increase heap size. Can be done by defining ANT_OPTS=-Xmx640m
See the JDK tooldocs.
/home/wardep/dev/autosalvage/claimcentrephase4/autosalvage-projects/common/components/uidgen-ejb/build.xml:76: null
BUILD FAILED (total time: 4 seconds)
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Is it always at line 76? What is the build doing there?

You could try fork=yes on, for example, java tasks.

Did you try doing what it suggested? "Try to increase heap size. Can be done by defining ANT_OPTS=-Xmx640m "
e. cordero
Greenhorn

Joined: Jun 21, 2004
Posts: 3
i'm new to building java apps with ant, so bear with me. i'm trying to build my first java application with ANT (not a new app, but my first time building it). i'm also getting an out of memory error, so i tried the memory incrase (as suggested above), but i'm not sure WHERE to put that.

i know there should be an ant.config file (shouldn't there?) but there isn't and i'm not sure what's supposed to be in it. the only reference i have is an ant.bat file used when the app is built using a windows machine. we're a mixed platform group of developers, so it would be nice to be able to help out with builds as needed using my os x machine.

any tips, urls, etc. would be appreciated.


ec
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
ANT_OPTS is an environment variable you can set, just like PATH and CLASSPATH are environment variables.

Ant manual - running ant describes ANT_OPTS as arguments that should be passed to the JVM like maximum head size.

ANT_OPTS - command-line arguments that should be passed to the JVM. For example, you can define system properties or set the maximum Java heap size here.
e. cordero
Greenhorn

Joined: Jun 21, 2004
Posts: 3
thanks for the info! hopefully, that will help me figure out this (simple?) problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant - Try to increase heap size error