You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David McTavish <dm...@SANDVINE.com> on 2002/11/05 21:25:53 UTC

ant.system.gc()?

Is there anyway to tell ant to run the garbage collection? I have a fairly
complicated build script that must execute peer projects so that it can
properly import the dependent libraries. What is happening, is that every
peer build process that is called stays in memory until the entire build
process is complete. This results in an ever-increasing JVM, until the point
that the JVM throws an OutOfMemoryError. (This is occuring at about 80MB). I
COULD set the upper limit higher, but it seems a little ridiculous that ant
takes 80 MB to compile the source.

any ideas?
thx,
d.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ant.system.gc()?

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 5 Nov 2002, David McTavish <dm...@sandvine.com> wrote:

> This results in an ever-increasing JVM, until the point that the JVM
> throws an OutOfMemoryError.

If the OOME occurs, the garbage collector has already been called -
doing so explicitly won't help.

Which version are you using?  Ant 1.5 has a known memory leak in <ant>
and <antcall> if you use nested <property>/<param> tags.  1.5.1 is
supposed to fix that.

> but it seems a little ridiculous that ant takes 80 MB to compile the
> source.

That could hint that javac and not Ant is the problem.  You could fork
<javac> or use jikes (or any other compiler you like) to get around
known resource leaks in javac itself.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ant.system.gc()?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
David McTavish wrote:
> Is there anyway to tell ant to run the garbage collection? I have a fairly
> complicated build script that must execute peer projects so that it can
> properly import the dependent libraries. What is happening, is that every
> peer build process that is called stays in memory until the entire build
> process is complete. This results in an ever-increasing JVM, until the point
> that the JVM throws an OutOfMemoryError. (This is occuring at about 80MB). I
> COULD set the upper limit higher, but it seems a little ridiculous that ant
> takes 80 MB to compile the source.
> 
> any ideas?

You misunderstood garbage collections. Explicit gc() is of
no help in such situations, because gc happens anyway if
available memory is low. An OutOfMemoryError happens if there
is really no memory to reclaim and the limit is reached.

Actually, Ant takes quite a bit of memory to read huge source
trees, and there are issues with certain Ant tasks (for example
antcall) which could be considered memory leaks. The only
solution is to increase the JVM memory settings and/or wait
until the memory leaks are confirmed and fixed.

J.Pietschmann


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ant.system.gc()?

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "David McTavish" <dm...@SANDVINE.com>
To: "'Ant Users List'" <an...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 12:25 PM
Subject: ant.system.gc()?


> Is there anyway to tell ant to run the garbage collection? I have a fairly
> complicated build script that must execute peer projects so that it can
> properly import the dependent libraries. What is happening, is that every
> peer build process that is called stays in memory until the entire build
> process is complete. This results in an ever-increasing JVM, until the
point
> that the JVM throws an OutOfMemoryError. (This is occuring at about 80MB).
I
> COULD set the upper limit higher, but it seems a little ridiculous that
ant
> takes 80 MB to compile the source.

This is more likely a memory leak than anything else.

-use java1.4 or fork javac (it leaked in 1.3)
-use ant1.5.1 that fixes leaks related to <ant>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ant.system.gc()?

Posted by Matt Benson <gu...@yahoo.com>.
What about a script?

-Matt

--- David McTavish <dm...@SANDVINE.com> wrote:
> Is there anyway to tell ant to run the garbage
> collection? I have a fairly
> complicated build script that must execute peer
> projects so that it can
> properly import the dependent libraries. What is
> happening, is that every
> peer build process that is called stays in memory
> until the entire build
> process is complete. This results in an
> ever-increasing JVM, until the point
> that the JVM throws an OutOfMemoryError. (This is
> occuring at about 80MB). I
> COULD set the upper limit higher, but it seems a
> little ridiculous that ant
> takes 80 MB to compile the source.
> 
> any ideas?
> thx,
> d.
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>