Issue Details (XML | Word | Printable)

Key: RVM-632
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ian Rogers
Reporter: Ian Rogers
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RVM

Space improvements of RVMClass.objectCache

Created: 15/Aug/08 04:01 AM   Updated: 22/Aug/08 07:00 AM
Component/s: Runtime
Affects Version/s: 3.0
Fix Version/s: 3.0.1

Time Tracking:
Not Specified


 Description  « Hide
RVMClass has a final LinkedList called objectCache that is currently used to hold references to InterfaceMethodConflictResolver stubs. As many classes don't implement interfaces, having a final LinkedList per RVMClass seems space inefficient. I'd propose the object cache perhaps be turned into a static global hashset, or that we're clever about how we populate the RVMClass objectCache. For example, initially objectCache could be null, if one item is added it could just reference that item then when more items are added an array or linked list could be created. I imagine the size of the cache the majority of the time is 0 and occasionally it is 1, with very infrequently it being 2 or more.

Using data from the boot image write of a prototype build: there are 1190 RVMClasses and 1190 linked lists, there are only 216 linked list elements, therefore more than 800 linked lists are empty.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
David Grove added a comment - 18/Aug/08 01:40 PM
I believe the only thing we use objectCashe for is to cause the GC to see the stubs as live, but I think it's preferable to keep as a per-class data structure. Should be ok to make the outer LinkedList object null unless there is something in the list.

Ian Rogers added a comment - 22/Aug/08 07:00 AM
Fix in r14915.