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 is a placeholder for the second leak described in detail in issue 60255. Specifically, in NB 5.0, there is a static map of existing DeploymentConfiguration instances that is holding onto an instance after the corresponding project is closed. This is leaking 10-100k of memory per project instance opened in an IDE session.
The map in question is a WeakHashMap, but the key used currently is apparently never freed and actually there probably isn't a key that can be used that fits the contract for WeakHashMap. The solution for the leak, recommended by Stepan, is have the map hold a WeakReference to a DeploymentConfiguration instead of a strong reference. Since j2eeserver will have a strong reference to any valid DeploymentConfiguration, there should not be a concern that the configuration would be prematurely garbage collected. I have implemented this and it works well. I have kept the WeakHashMap so that the WeakReference holder will also be garbage collected when the keys are released (which they will be, now that the DeploymentConfiguration can be.)
Fixed. http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/SunONEDeploymentConfiguration.java?r1=1.24&r2=1.25
Created attachment 27960 [details] Patch to fix this bug.
this looks fine to me.
Fix committed to release50 branch.