ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myron Uecker" <uec...@us.ibm.com>
Subject Re: java compilation out of memory problem
Date Fri, 06 Jul 2001 12:51:36 GMT

>I run javac task on Ant to compile about 1250 java files. It starts
>fine, but after compiling several java programs ( about 20 of them) I
>got a run-out-of-memory error. The message also suggests using a
>switch  -J-mx<nmbs>. I cannot find any document mentioning such a
>switch. Has any one encountered such a situation and got a solution to
>this problem?

The javac command runs under the same JVM as ant itself.  If you give ant
more memory, it will pass it on to javac.  What I found to work is to
modify one of the batch files in the bin directory (ant.bat, ant, etc) and
add the -mx and -ms options on the call to java ($JAVACMD).  For example,
this is the last line of my ant shell script where I set the memory size:

$JAVACMD -mx65536000 -ms65536000 -classpath "$LOCALCLASSPATH" $ANT_OPTS
org.apache.tools.ant.Main "$@"

Myron Uecker
muecker@att.com



Mime
View raw message