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: | Massive memory leak perhaps caused by AnnotationHolder.file2Holder | ||
---|---|---|---|
Product: | editor | Reporter: | Jesse Glick <jglick> |
Component: | Hints & Annotations | Assignee: | Milutin Kristofic <mkristofic> |
Status: | NEW --- | ||
Severity: | normal | Keywords: | PATCH_AVAILABLE, PERFORMANCE |
Priority: | P2 | ||
Version: | Dev | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Possible fix (not yet tested) |
Description
Jesse Glick
2017-01-30 17:00:32 UTC
Adding PERFORMANCE keyword since I see nothing related to heap usage specifically. Created attachment 163510 [details]
Possible fix (not yet tested)
Another bad reference which puts more of the blame on `file2Holder`: this - value: org.netbeans.lib.lexer.token.DefaultToken #142002 <- [1733] - class: java.lang.Object[], value: org.netbeans.lib.lexer.token.DefaultToken #142002 <- elementData - class: org.netbeans.lib.lexer.inc.IncTokenList, value: java.lang.Object[] #272130 <- rootTokenList - class: org.netbeans.lib.lexer.TokenHierarchyOperation, value: org.netbeans.lib.lexer.inc.IncTokenList #90 <- operation - class: org.netbeans.spi.lexer.TokenHierarchyControl, value: org.netbeans.lib.lexer.TokenHierarchyOperation #92 <- thc - class: org.netbeans.lib.lexer.inc.DocumentInput, value: org.netbeans.spi.lexer.TokenHierarchyControl #90 <- value - class: java.util.Hashtable$Entry, value: org.netbeans.lib.lexer.inc.DocumentInput #90 <- [47] - class: java.util.Hashtable$Entry[], value: java.util.Hashtable$Entry #74934 <- table - class: org.netbeans.modules.editor.NbEditorDocument$4, value: java.util.Hashtable$Entry[] #4463 <- documentProperties - class: org.netbeans.modules.csl.core.GsfDocument, value: org.netbeans.modules.editor.NbEditorDocument$4 #89 <- doc - class: org.netbeans.modules.editor.hints.AnnotationHolder, value: org.netbeans.modules.csl.core.GsfDocument #5 <- value - class: java.util.HashMap$Node, value: org.netbeans.modules.editor.hints.AnnotationHolder #19 <- next - class: java.util.HashMap$Node, value: java.util.HashMap$Node #735218 <- [20] - class: java.util.HashMap$Node[], value: java.util.HashMap$Node #722852 <- table - class: java.util.HashMap, value: java.util.HashMap$Node[] #106870 <- file2Holder - class: org.netbeans.modules.editor.hints.AnnotationHolder, value: java.util.HashMap #35394 Probably the use of `WeakHashMap` here is futile due to the `od` and `file` fields (oddly not `final`), which suggests that `clearAll` is not getting called often enough, perhaps because `resolveAllComponents` is buggy. Or perhaps `EditorRegistry.componentList` is returning long-closed editor tabs? Perhaps because the use of a `HashSet` for `openedComponents` caused these tabs to be retained? Hard to follow what the root cause is here. Have been running with this patch and so far memory usage seems much better. Hard to be sure since I do not know how to reproduce the problem from scratch. The problem is not solved with this patch. After closing all projects and every project-related window, memory usage remained high, and in a dump I found the *complete text* of a file I had been editing the day before, held via org.netbeans.modules.editor.lib2.document.ContentEdit$InsertEdit.text org.netbeans.modules.editor.NbEditorDocument.lastModifyUndoEdit org.netbeans.modules.diff.builtin.visualizer.editable.EditableDiffView.modifiedDocument org.netbeans.modules.diff.builtin.visualizer.editable.DiffContentPanel.master org.netbeans.modules.diff.builtin.visualizer.editable.DecoratedEditorPane.master org.netbeans.editor.BaseTextUI.editor org.netbeans.editor.BaseDocument$OldListenerAdapter.delegate javax.swing.event.EventListenerList.listenerList org.netbeans.modules.editor.NbEditorDocument.listenerList org.netbeans.modules.editor.hints.AnnotationHolder.doc java.util.WeakHashMap$Entry.value java.util.WeakHashMap$Entry chunk.next java.util.WeakHashMap.table org.netbeans.modules.editor.hints.AnnotationHolder.file2Holder |