ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: "OutOfMemoryException: PermGen space" error with Ant?
Date Sun, 24 Jun 2012 08:41:14 GMT
On 2012-06-23, Charles Chan wrote:

> I was using dbunit's Ant integration and have a for loop that exports
> a bunch of dataset into many small xml files (less than 5-50kb
> each). After repeating <dbunit> task for ~50 times, I got an
> OutOfMemoryException: PermGen space.

There are several hints about a memory leak in Ant related to not
cleaning up classloaders used for loading typedefs/taskdefs in
subbuilds.  So far we haven't pinned down the problem.

Are you defining the dbunit tasks inside the <for> or are you spawning
new <ant> or <subant> ot <antcall> tasks inside <for> that would do
so?
If so you may be able to work around the problem by defining the tasks
inside the main build before the for loop.

The other things you may be leaking are JDBC drivers.  You could try to
load the driver inside the main build explicitly so it never ends up on
any other classloader (<available> should help).

Stefan

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


Mime
View raw message