Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353560 - EDC uses more memory than necessary
Summary: EDC uses more memory than necessary
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-edc (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Ken Ryall CLA
QA Contact: Ken Ryall CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-02 07:01 EDT by Daniel Thomas CLA
Modified: 2012-05-22 20:34 EDT (History)
3 users (show)

See Also:


Attachments
6 patches to reduce memory consumption (26.09 KB, patch)
2011-08-02 07:45 EDT, Daniel Thomas CLA
cdtdoug: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Thomas CLA 2011-08-02 07:01:42 EDT
Build Identifier: I20110613-1736

There are a number of areas where some memory consumption can be shaved off EDC.
 * FileLineEntryProvider creates larger ArrayLists than it needs in some situations
 * Many ForwardReferenceTypes can be created per IType which is being referenced
 * SectionMapper can create buffers larger than it needs if it reads to the end of a file
 * DwarfInfoReader can add a variable to the list of variables when that list already contains the variable to be added.

I have a patch which addresses these issues.

Reproducible: Always

Steps to Reproduce:
1. Analyze an executable and create a heapdump
2. Analyze the heapdump and look at where memory is  going
Comment 1 Daniel Thomas CLA 2011-08-02 07:45:51 EDT
Created attachment 200704 [details]
6 patches to reduce memory consumption
Comment 2 Kirk Beitz CLA 2011-08-04 21:19:03 EDT
the patch looks good, and i've applied the entire patch in our working source base for now.  i believe ken will be merging our source base with the eclipse git repository soon.


for purposes of telling these items apart, i am labeling them 1 thru 4 here:

1) Many ForwardReferenceTypes can be treated per IType which is being referenced

2) FileLineEntryProvider creates larger ArrayLists than necessary at times

3) SectionMapper can create buffers larger than necessary at times

4) DwarfInfoReader can add a variable to a list when it's already in that list


in the future, it might have been better to treat these as four separate bugzilla issues with four separate patches, in case one of them caused our tests to fail, or in case there are other problems requiring us to back out one part.  e.g. it wasn't obvious to me in looking at just the file that the change in Variable.java was related to item (4) above, but if these were separate bugzilla issues, the patch would have been more wholistic and self-contained.
Dwarf
Comment 3 Kirk Beitz CLA 2011-08-04 21:19:19 EDT
patch applied and nominally tested locally; awaiting final review and final merge to eclipse edc git repository by ken ryall.