Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356789

Summary: Memory leak in DwarfInfoReader as Jobs are kept by ProgressViewUpdater forever
Product: [Tools] CDT Reporter: Daniel Thomas <daniel.thomas>
Component: cdt-debug-edcAssignee: Ken Ryall <ken.ryall>
Status: RESOLVED WONTFIX QA Contact: Ken Ryall <ken.ryall>
Severity: normal    
Priority: P3 CC: cdtdoug, kirk.beitz
Version: 8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch creating a static ParseJob class to do the anonymous inner class Job's work and fix dispose method none

Description Daniel Thomas CLA 2011-09-06 05:57:11 EDT
Build Identifier: 

ProgressViewUpdater keeps (by a few layers of indirection) references to all Jobs (or at least the ones we care about) so if a Job is an anonymous class or a non static member class then its reference to the parent class will keep that instance around forever as well. If a Job as in this case is only intended to be used once for a fairly brief period of time this results in a problem.

I have a patch which fixes this up and stops GC errors when analyzing multiple exes in a row (such as during some testing) results in a GC error as all data is accumulated.

Additionally DwarfDebugInfoProvider's dispose() method which would have mitigated this problem does not clear() all the things it should allowing references to everything to persist.

I have a patch which fixes this.

Reproducible: Always
Comment 1 Daniel Thomas CLA 2011-09-06 05:58:52 EDT
Created attachment 202793 [details]
Patch creating a static ParseJob class to do the anonymous inner class Job's work and fix dispose method
Comment 2 Kirk Beitz CLA 2011-09-06 17:21:55 EDT
i've nominally tested this using our JUnit suite (including the edc JUnit suite), and have committed it to our local repository, pending final review and eclipse edc git merge by committer ken ryall.
Comment 3 Jonah Graham CLA 2019-12-30 18:39:28 EST
(this is part of a batch change)

The Eclipse CDT EDC (https://wiki.eclipse.org/CDT/cdt-debug-edc) is now obsolete and has not had any active development since 2011. Therefore the still open bugs are being marked as wontfix.

The git repo for the project still exists for posterity at https://git.eclipse.org/c/cdt/org.eclipse.cdt.edc.git/