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.
Try the attached build script. (Change ${base} as needed.) Every time I run it, I get an approx. 10Mb heap leak. This is after correcting various other Ant-related leaks. Seems to leak with both Ant 1.5.3 and 1.6 beta. You can look at the heap using a profiler after running the script. It has a bunch of instances of Project, and associated tasks and types and so on. The main Project ("Current API &Javadoc") is not among them - just subprojects. Both HAT and OptimizeIt display the stray instances. But neither show any references from persistent roots. I cannot track down why the object graphs are being held. It seems that running trivial Ant scripts do not leak this way. In fact, I tried (under a profiler) running the three subcomponents of the wrapper script by themselves, as well as the run-nb target (without a dep on the run target), and in all cases the Project graph was collected. But running the whole script reproducibly leaks.
Created attachment 11794 [details] Problematic script
Huh, never mind. The objects *do* get released - several minutes later. Just pressing GC twenty times doesn't do it; you have to wait. Perhaps some of the objects got stuck into an older GC generation and didn't get cleaned out easily?
closed