Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355328 - [otre] class RepositoryAccess is wasting memory
Summary: [otre] class RepositoryAccess is wasting memory
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 2.0   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-21 18:29 EDT by Stephan Herrmann CLA
Modified: 2013-02-20 15:14 EST (History)
0 users

See Also:


Attachments
Implementation of diet class loading (23.84 KB, patch)
2011-08-23 08:44 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-08-21 18:29:57 EDT
In a heap dump of an OTDT that has been working for quite some time
I can see that almost 50% of the memory are consumed by class
org.eclipse.objectteams.otre.RepositoryAccess via static field
repositories. This hashmap keeps instances of JavaClass for further
lookup, but most clients of this lookup are only interested in
superclass/ifc linkage.

Only one location uses the JavaClass for searching a method signature.
This is during ObjectTeamsTransformation.addTeamInitializations() 
while evaluating a team-config for standalone OT/J app.

It should be possible to store this information in a much more compact
form.
Comment 1 Stephan Herrmann CLA 2011-08-23 08:44:22 EDT
Created attachment 201992 [details]
Implementation of diet class loading

This patch implements diet versions of ClassLoaderRepository,
ClassParser and JavaClass, which only read structural information
and dispose the constant pool after reading.

Only one client needs to lookup a method signature:
ObjectTeamsTransformation.addTeamInitializations(),
which is now handled by a new method lookupClassFully().

When running the OTDT (SDK based install) with OT perspective and a
team class open, I could observe (using MAT) the following improvement:

Old: class RepositoryAccess retains 239 MBytes on the heap!
New: class RepositoryAccess retains 2.3 MBytes on the heap!
Comment 2 Stephan Herrmann CLA 2011-08-23 08:48:48 EDT
Patch has been released for 2.1 M2 (r1959).
Comment 3 Stephan Herrmann CLA 2013-02-20 15:14:37 EST
Verified: using 2.2 M5 RepositoryAccess is no longer relevant in terms of retained memory.