Bug 164162

Summary: [implementation] Memory leak in AbstractJavaCompletionProposal due to synthetic this$0 field of anonymous class
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2 Keywords: investigate
Version: 3.3   
Target Milestone: 3.3 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
YourKit insights none

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