Hi,
I've found the source of the file handle leaks on the project I've been
working on.
Ant internally uses an AntClassLoader. It keeps a cache of File →
JarFile (AntClassLoader#jarFiles). This cache holds _open_ JarFile
objects. This cache is designed to be open for the duration of the
build, and then closed at the end. The problem is that we never tell Ant
that the build has finished and therefore it never closes this cache.
To remedy this, we need to make sure we call fireBuildFinished() on all
ant Project instances when the build is over. For IsolatedAntBuilder
this is easy. Does anyone have any good ideas on where to do this for
Project.getAnt() ?
- [gradle-dev] Windows file handle leaks when using AntBuilder. Luke Daley
-