You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Xiangzhou Wang <xi...@yahoo.com> on 2006/03/16 19:15:01 UTC

ant memory leak - not fixed???

Hi,

I know it is not a new problem.

I am using ant 1.6.5 to compile large number of java
files pre-generated from jsp pages with tomcat 5.5.15
jspC. The total number of bytes of these java files is
around 150 MB, total class is 40MB, total lib (exclude
java) is 21MB.

I am using ant only, NO IDE tools. the javac config
is:
    <javac destdir="${build.home}/WEB-INF/classes"
           optimize="off"
           debug="on" failonerror="false"
           srcdir="${build.home}/WEB-INF/src" 
           memoryInitialSize="512m"
           memoryMaximumSize="512m"
           source="1.5"
           target="1.5"
           fork="true" verbose="5" listfiles="true">
        ....for classpath
    </javac>

I always get failure because of "system out of
resource". 

    [javac] The system is out of resources.
    [javac] Consult the following stack trace for
details.
    [javac] java.lang.OutOfMemoryError: Java heap
space
    [javac] Compile failed; see the compiler error
output for details.


The ant process eats up large chunk of memory (>500MB,
total memory is 1GB). I also used javac -XX:paralelGC
to launch ant, still the same error. I set fork for
true and false, both have same error too.

It is claimed the memory leak is fixed, is there
anyone with similar problem? How to solve it? 

It seems to me that ant caches a lot of things in the
memory, is there a way to hack ant to force disk
writing.

Many thanks,
William


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: ant memory leak - not fixed???

Posted by Stephen McConnell <mc...@dpml.net>.
 

> -----Original Message-----
> From: Steve Loughran [mailto:stevel@apache.org] 

> This is not an ant problem. This is javac, which is probably 
> just very memory hungry on account of the large number of 
> pages to compile. Please dont blame us.

Is there a way he could reduce the number of files in the compilation
selection - on the assumption that the successful build could be achieved by
running multiple compilation passes?

/Steve.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant memory leak - not fixed???

Posted by Steve Loughran <st...@apache.org>.
Xiangzhou Wang wrote:
 > Hi,
 >
 > I know it is not a new problem.
 >
 > I am using ant 1.6.5 to compile large number of java
 > files pre-generated from jsp pages with tomcat 5.5.15
 > jspC. The total number of bytes of these java files is
 > around 150 MB, total class is 40MB, total lib (exclude
 > java) is 21MB.
 >
 > I am using ant only, NO IDE tools. the javac config
 > is:
 >     <javac destdir="${build.home}/WEB-INF/classes"
 >            optimize="off"
 >            debug="on" failonerror="false"
 >            srcdir="${build.home}/WEB-INF/src"
 >            memoryInitialSize="512m"
 >            memoryMaximumSize="512m"
 >            source="1.5"
 >            target="1.5"
 >            fork="true" verbose="5" listfiles="true">
 >         ....for classpath
 >     </javac>
 >
 > I always get failure because of "system out of
 > resource".
 >
 >     [javac] The system is out of resources.
 >     [javac] Consult the following stack trace for
 > details.
 >     [javac] java.lang.OutOfMemoryError: Java heap
 > space
 >     [javac] Compile failed; see the compiler error
 > output for details.
 >
 >
 > The ant process eats up large chunk of memory (>500MB,
 > total memory is 1GB). I also used javac -XX:paralelGC
 > to launch ant, still the same error. I set fork for
 > true and false, both have same error too.
 >
 > It is claimed the memory leak is fixed, is there
 > anyone with similar problem? How to solve it?

Looks to me like you have run out of space in javac. As you are forking 
javac, this is not an ant bug. I repeat: this is not an ant bug.

Why not ask for more memory for javac.


 > It seems to me that ant caches a lot of things in the
 > memory, is there a way to hack ant to force disk
 > writing.

This is not an ant problem. This is javac, which is probably just very 
memory hungry on account of the large number of pages to compile. Please 
dont blame us.


-steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org