This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This memory leak is fixed in Ant 1.6 beta 1. However NetBeans using an older integration, e.g. 1.5.3, will still suffer from it, esp. in the trunk (since NB can load Ant multiple times under low memory conditions). This can cause OutOfMemoryError's in the worst case. Might be possible to work around by the following hack: After running a project, use introspection to load java.lang.Shutdown. Get its static field 'hooks' and cast to Set. Iterate through them. Cast each to Shutdown.WrappedHook, and get the field 'hook' from it. If the impl class of the value is named org.apache.tools.ant.taskdefs.ProcessDestroyer (the name under Ant 1.5.3 but not 1.6 where the bug is fixed), cast the object to Thread, and call Runtime.default.removeShutdownHook(thing).
Have patch that appears to be working.
Fixed as part of issue #36396.
Will enhance workaround to also start the hook when it removes it, solving the ThreadGroup memory leak described in issue #36395. (Ant 1.6 also has the same workaround, so when 1.6 is integrated this will be solved as well.)
Workaround for issue #36395 added: committed * Up-To-Date 1.5 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/BridgeImpl.java
Jesse, as a reporter could you verify this bug to close its life cycle? Thanks!
Well I would have to actually verify that the fix is still working in current trunk code, which is time-consuming... no time for it right now. Should probably be covered by a unit test I suppose.
Verified.