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 250639 - Suspicious static map
Summary: Suspicious static map
Status: RESOLVED INVALID
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 8.0
Hardware: All All
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-23 16:18 UTC by Tomas Hurka
Modified: 2015-04-27 08:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2015-02-23 16:18:58 UTC
There is static HashMap file2Holder in org.netbeans.modules.editor.hints.AnnotationHolder class. It uses DataObject as key and  AnotationHolder instance as value. Please investigate if data in this static Map are properly released and that there is no memory leak. You can use heap dump from issue #250638 to see suspicious content of file2Holder Map.
Comment 1 Svata Dedic 2015-04-27 08:11:08 UTC
The map items are released as soon as a CloneableEditor attached to the dataobject closes/is removed from the EditorRegistry. 

Size of the map (= 42) << # of GsfDocument( = 169), so at least some AnnotationHolders are released as expected.

The static Map could be eventually turned to WeakMap keeping AnnoHolders with WeakReference -- the holder attaches itself as [hard] listener to the underlying Document during construction, so it will be kept as long as the Document and DO lives, but it's not necessary IMHO given the cleanup sequence.