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

Bug 338457

Summary: Memory Improvement: Reduce the footprint of XMLDescriptor
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.sdo-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 334389    
Attachments:
Description Flags
Core - Fix
none
Core - Fix
none
Core - Fix none

Description Blaise Doughan CLA 2011-02-28 14:52:17 EST
Currently XMLDescriptor is showing up as retaining the most memory (including transitive properties).  Although this makes sense since this represents the stateful information, we should improve memory usage here where we can.
Comment 1 Blaise Doughan CLA 2011-02-28 15:00:02 EST
Created attachment 189988 [details]
Core - Fix

Changes:

- Initialized size of primaryKeyFields from 2 to 1, ideally we would not initialize this collection all all since most XMLDescriptors do not have primary key fields, but this would be a larger change.
- Use Collections.EMPTY_LIST & Collections.EMPTY_MAP for several list and map properties that are not used by OXM, but EclipseLink requires to be non-null.
- Created a static variable for EMPTY_VECTOR where Collections.EMPTY_LIST can not be used.
- Created a custom CopyPolicy that does nothing, since EclipseLink requires that a copy policy be set.
Comment 2 Blaise Doughan CLA 2011-02-28 15:27:16 EST
Created attachment 189992 [details]
Core - Fix
Comment 3 Blaise Doughan CLA 2011-03-02 12:24:52 EST
Created attachment 190179 [details]
Core - Fix

Changes:

- Initialized size of primaryKeyFields from 2 to 1, ideally we would not
initialize this collection all all since most XMLDescriptors do not have
primary key fields, but this would be a larger change.
- Use Collections.EMPTY_LIST & Collections.EMPTY_MAP for several list and map
properties that are not used by OXM, but EclipseLink requires to be non-null.
- Created a static variable for EMPTY_VECTOR where Collections.EMPTY_LIST can
not be used.

Note:
Due to an issue trying to have an optimized CopyPolicy with deployment XML, this change will not be covered by this bug.
Comment 4 Blaise Doughan CLA 2011-03-02 12:29:47 EST
Fix checked into trunk at rev:  9055
Fix checked into 2.2.1 at rev:  9056
Fix checked into 2.1.3 at rev:  9057

Code reviewed by:  Rick Barkhouse
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:21:52 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink