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 - Memory leak in org.openide.explorer.propertysheet.PropertyDialogManager
Summary: Memory leak in org.openide.explorer.propertysheet.PropertyDialogManager
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: PERFORMANCE, TEST
Depends on:
Blocks: 123530
  Show dependency tree
 
Reported: 2007-12-12 22:54 UTC by _ sandipchitale
Modified: 2008-12-22 11:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff with possible fix for the leak. (2.35 KB, text/plain)
2007-12-12 22:56 UTC, _ sandipchitale
Details

Note You need to log in before you can comment on or make changes to this bug.
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