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.

Bug 123918

Summary: Memory leak in org.openide.explorer.propertysheet.PropertyDialogManager
Product: platform Reporter: _ sandipchitale <sandipchitale>
Component: ExplorerAssignee: Stanislav Aubrecht <saubrecht>
Status: RESOLVED FIXED    
Severity: blocker CC: quynguyen
Priority: P2 Keywords: PERFORMANCE, TEST
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 123530    
Attachments: Diff with possible fix for the leak.

Description _ sandipchitale 2007-12-12 22:54:57 UTC
The org.openide.explorer.propertysheet.PropertyDialogManager is leaking anonymous instances of PropertyChangeListeners
that are registered on the component field.

Attached diff fixes the issue.

Steps:

1. Create VW Web Project
2. Expand to and select the body node (under Page1 node )in the Outline (Navigator) window.
3. In the property sheet click on the [...] button of style property and cancel the dialog.
4. Do this 10 times. Save and close the page.
5. Take a heap dump using tool like jmap.
6. Load the heap dump in NetBeans profiler.
7. Search for class named StyleBuilderPanel or PropertyDialogManager.
8. Show its instances in the Instances window.
9. You will see 10 instances.
10. Show the GC root of any instance. You will see the leak.

Apparently code uses the same field which isassigned two instances of anomymous PropertyChangeListeners. So the
reference to the first is lost. Also the code does not seem to be be attempting to remove the listener from component
field but only from editor field.
Comment 1 _ sandipchitale 2007-12-12 22:56:10 UTC
Created attachment 54211 [details]
Diff with possible fix for the leak.
Comment 2 _ sandipchitale 2007-12-13 00:22:43 UTC
BTW this leak happens for Border property editor for in JPanel form also.
Comment 3 Stanislav Aubrecht 2007-12-14 10:25:55 UTC
fixed

/cvs/openide/explorer/src/org/openide/explorer/propertysheet/PropertyDialogManager.java,v  <--  PropertyDialogManager.java
new revision: 1.12; previous revision: 1.11