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 269797

Summary: Memory leak in FileSearchAction.panel
Product: utilities Reporter: Jesse Glick <jglick>
Component: Jump ToAssignee: Tomas Zezula <tzezula>
Status: NEW ---    
Severity: normal Keywords: PATCH_AVAILABLE, PERFORMANCE
Priority: P3    
Version: Dev   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Possible fix (not yet tested)

Description Jesse Glick 2017-02-10 14:50:06 UTC
20170130 dev build with hundreds of megs consumed after closing all projects, closing all project-related windows, etc. Analyzing leaked project references in a dump, one I found with this root reference trail:

org.apache.maven.project.MavenProject
org.apache.maven.project.MavenProject.parent
org.netbeans.modules.maven.api.customizer.ModelHandle2.project
org.netbeans.modules.maven.customizer.CustomizerProviderImpl.handle2
org.openide.util.lookup.SingletonLookup.objectToLookup
org.openide.util.lookup.ProxyLookup$RealInternalData.lookups
org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.data
java.util.ArrayList.elementData
org.netbeans.spi.project.support.DelegatingLookupImpl.currentLookups
org.netbeans.modules.maven.NbMavenProjectImpl.completeLookup
org.netbeans.modules.jumpto.file.FileDescription.project
org.netbeans.modules.jumpto.file.FileSearchAction$AsyncFileDescriptor.delegate
org.netbeans.modules.jumpto.file.FileSearchPanel.selectedFile
org.netbeans.modules.jumpto.file.FileSearchAction.panel
org.openide.loaders.FolderInstance$1R.instances
org.openide.awt.MenuBar$LazyMenu$MenuFolder.creationTask
org.openide.awt.MenuBar$MenuBarFolder.waitFor
org.openide.awt.MenuBar.menuBarFolder

It seems `FileSearchPanel` holds a strong reference to a given `Project`, so the `panel` field needs to be cleaned up. `cleanup` deletes `dialog`, which is good, but not `panel`.
Comment 1 Jesse Glick 2017-02-10 14:51:16 UTC
Created attachment 163611 [details]
Possible fix (not yet tested)
Comment 2 Jesse Glick 2017-06-19 17:21:46 UTC
That patch does not work—causes bug #270909.