ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Deragon <>
Subject Re: Newbie gets OutOfMemoryError.
Date Wed, 13 Mar 2002 00:18:42 GMT

   It fails again.  I have only 136 .java files to compile, but it 
fails.    Running ant with -v -debug options shows that ant seams to 
ignore the javac options (I do not see any reference to fork for 
instance).   Following your instructions, this is the build.xml I used:

<project name="antmm" default="compile" basedir=".">

   <!-- set global properties for this build -->
   <property name="src"             value="/usr/java/src"/>
   <property name="build"           value="/usr/java/classes"/>
   <property name="cache"           value="/usr/java/antcache"/>
   <property name="build.compiler"  value="modern"/>

   <target name="init">
     <!-- Create the time stamp -->
     <!-- Create the build directory structure used by compile -->
     <mkdir dir="${build}"/>

   <target name="compile" depends="init">
     <!-- Compile the java code from ${src} into ${build} -->
     <javac fork="true" debug="on" verbose="on" destdir="${build}" 
memoryInitialSize="256m" memoryMaximumSize="256m">
         <pathelement path="${src}"/>

   <target name="clean">
     <!-- Delete the ${build} and ${dist} directory trees -->
     <delete dir="${build}"/>

Hans Deragon

Diane Holt wrote:

> --- Hans Deragon <> wrote:
>>I am a newbie and get the famous OutOfMemoryError.  I want to try to 
>>avoid breaking up the building sequence and have all the source
>>compiled under one single easy target.
>>I tried many options regarding the javac task, but I get the feeling 
>>that it does not help much.
> You just kept bumping up against Catch-22's -- you can't use the
> memory*Size attributes unless you use fork="true", and you can't use fork
> and run the Jikes compiler :)
> Try running Ant itself with more memory by setting the ANT_OPTS env var to
> whatever the memory-increase flag is for the version of Java you're
> running (eg., ANT_OPTS=-Xmx256m).
> Diane
> =====
> (
> __________________________________________________
> Do You Yahoo!?
> Try FREE Yahoo! Mail - the world's greatest free email!
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message