Bug 519085 - [memory] SimpleArtifactDescriptor / OrderedProperties memory efficiency
Summary: [memory] SimpleArtifactDescriptor / OrderedProperties memory efficiency
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 4.7.0 Oxygen   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: Photon M7   Edit
Assignee: Karsten Thoms CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-03 03:03 EDT by Karsten Thoms CLA
Modified: 2018-03-16 01:33 EDT (History)
1 user (show)

See Also:


Attachments
Screenshot (706.90 KB, image/png)
2017-07-03 03:07 EDT, Karsten Thoms CLA
no flags Details
Screenshot: Profiler (491.77 KB, image/png)
2017-07-03 03:17 EDT, Karsten Thoms CLA
no flags Details
Screenshot: Profiler (662.20 KB, image/png)
2017-07-03 03:20 EDT, Karsten Thoms CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2017-07-03 03:03:28 EDT
A memory profile reveiled that SimpleArtifactDescriptor is holding in most cases an empty OrderedProperties instance. With lazy initialization some thousand objects can be avoided. Further, most 'repositoryProperties' are a map with a single entry. For these, an OrderedProperties is oversized and Collections.singletonMap would do the job also.

Further inspection of OrderedProperties instances showed that the map keys are a rather discrete set of values. Therefore it makes sense to intern them.
Comment 1 Karsten Thoms CLA 2017-07-03 03:07:06 EDT
Created attachment 269162 [details]
Screenshot

16566 empty instances held by SimpleArtifactDescriptor
Comment 2 Karsten Thoms CLA 2017-07-03 03:17:31 EDT
Created attachment 269164 [details]
Screenshot: Profiler

SimpleArtifactDescriptor using >6MB
Comment 3 Karsten Thoms CLA 2017-07-03 03:20:04 EDT
Created attachment 269165 [details]
Screenshot: Profiler

Previous screenshot showed the already optimized case.
Consumption before: 6.265.168
            after : 4.660.408
            -----------------
                   -1.604.760
Comment 4 Eclipse Genie CLA 2017-07-03 05:53:00 EDT
New Gerrit change created: https://git.eclipse.org/r/100537