I have a 2gig linux 64bit OS. I am using ant 1.7.1 and jdk 1.6_31. I have a simple app that prints that asks for the size of the Maximum java heap and prints it. I am using export ANT_OPTS=”-Xmx64M” but when I run my little application with ant target in build.xml, it reports 446Meg.
<target name="askmem">
<java
fork="true"
classname="com.stagirite.test.AskMemory"
classpathref="project.classpath">
<classpath path="${build.dir}"/>
</java>
</target>
I must be doing something wrong? (I discovered from stackoverflow that with this JVM, the default heap is 1/4 total memory, which is what is happening, rather than the value I specified in ANT_OPTS.
Andy
You’re forking the Java anyway, so even if
ANT_OPTSdid affect thejavatask, I don’t think they’d transfer to it.ANT_OPTSis for ant itself.If you want to control the JVM used by the forked
javatask, use nested<jvmargs>elements.