ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <>
Subject Re: ant.system.gc()?
Date Tue, 05 Nov 2002 21:22:37 GMT
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.


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

View raw message