Anyone have any opinions on this? On 28 Nov 2013, at 2:54 am, Luke Daley <luke.da...@gradleware.com> wrote:
> On 27 Nov 2013, at 16:50, Luke Daley wrote: > > 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() ? > > Forgot to mention, the reason this didn't show up in the profiler is that > JarFile uses JNI and that actual file handle is at the native level (so > YourKit couldn't see it). > -- Luke Daley Principal Engineer, Gradleware http://gradleware.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email