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 204800 - Memory leak in GoToSymbolAction
Summary: Memory leak in GoToSymbolAction
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Jump To (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on: 209021
Blocks:
  Show dependency tree
 
Reported: 2011-11-07 20:31 UTC by Jesse Glick
Modified: 2012-03-24 11:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Reference chain (57.82 KB, image/png)
2011-11-07 20:31 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-11-07 20:31:38 UTC
Created attachment 112954 [details]
Reference chain

I noticed high heap usage in my IDE even though all projects and files were closed. Taking a heap dump, I found a number of Project impls still in memory.

The root reference chain analysis for one of them suggests that the static singleton GoToSymbolAction is holding a hard reference to a GoToPanel (whose selectedSymbol field holds a hard ref to a Project). This is nonsense: a context-free Action should have no instance fields unless it truly intends to maintain some sort of state across calls to actionPerformed.

BTW consider using @ActionRegistration for this action. (Means isEnabled will be ignored the first time the action is called in a given IDE session, due to lazy loading, but that is probably harmless - if no projects are open, there will just be no symbols in the list.)
Comment 1 Tomas Zezula 2012-03-22 10:51:22 UTC
Fixed jet-main 8543e8b27cab
Comment 2 Quality Engineering 2012-03-24 11:01:27 UTC
Integrated into 'main-golden', will be available in build *201203240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8543e8b27cab
User: Tomas Zezula <tzezula@netbeans.org>
Log: #204800:Memory leak in GoToSymbolAction