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.
Summary: | WebProject memory leak in JSFFrameworkProvider | ||
---|---|---|---|
Product: | obsolete | Reporter: | Quy Nguyen <quynguyen> |
Component: | visualweb | Assignee: | _ potingwu <potingwu> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | Keywords: | PERFORMANCE |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 123530 |
Description
Quy Nguyen
2008-01-16 01:47:43 UTC
Fixed in the trunk. Use WeakHashMap for holding the project property change listener instead of HashMap. BTW, it's a recent regression that is not in the NetBeans 6.0 release. The WeakHashMap is keyed on the WebProject instance, but the WebProject instance is reachable from the map entry's value. This prevents the entry from being automatically removed. The GC root path is below: WebProject[C:\Documents and Settings\qn145415\My Documents\NetBeansProjects\WebApplication65]: private static final java.util.Map org.netbeans.modules.visualweb.project.jsf.framework.JSFFrameworkProvider.propertyListeners-> java.util.WeakHashMap@fb12ab-table-> [Ljava.util.WeakHashMap$Entry;@1c08758-[3]-> java.util.WeakHashMap$Entry@93c018-value-> java.util.ArrayList@e1b81e-elementData-> [Ljava.lang.Object;@1c282fe-[0]-> org.netbeans.modules.visualweb.project.jsf.ui.JSFNodeFactory$JSFNodeList@f5aa7a-project-> org.netbeans.modules.web.project.WebProject@1254e91 Don't declare static for the HashMap and don't static cache JSFFrameworkProvider to prevent memory leak. Now I don't see JSFFrameworkProvider in the Run-time Watches list. It looks like the leak is fixed. However, you should consider using a normal HashMap instead of WeakHashMap since it doesn't work as expected anyway. |