Bug 164162 - [implementation] Memory leak in AbstractJavaCompletionProposal due to synthetic this$0 field of anonymous class
Summary: [implementation] Memory leak in AbstractJavaCompletionProposal due to synthet...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.3 M4   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2006-11-10 14:37 EST by Markus Keller CLA
Modified: 2006-12-12 12:19 EST (History)
0 users

See Also:


Attachments
YourKit insights (89.28 KB, image/png)
2006-11-10 14:38 EST, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2006-11-10 14:37:34 EST
I20061108-1600

I think I found a Memory leak in AbstractJavaCompletionProposal#getInformationControlCreator(): The anonymous class contains a synthetic this$0 field, which prevents the outer object from being garbage collected.

All in all, YourKit says that 121 instances of CompletionProposal are retained, which use up 22.5MB.

From looking at the code, I think the anonymous class is not necessary at all. A better solution would be a normal class. An instance of that subclass could even be shared among all completion proposals.
Comment 1 Markus Keller CLA 2006-11-10 14:38:17 EST
Created attachment 53648 [details]
YourKit insights
Comment 2 Dani Megert CLA 2006-11-13 06:55:03 EST
Fixed in HEAD. Also converted all other anonymous AbstractReusableInformationControlCreator subclasses.
Comment 3 Benno Baumgartner CLA 2006-12-12 11:54:23 EST
verifying...
Comment 4 Benno Baumgartner CLA 2006-12-12 12:19:02 EST
verified in I20061212-0010

- Code has changed
- No references to CompletionProposal found with YourKit