RVM

Space improvements of RVMClass.objectCache

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.0
  • Fix Version/s: 3.0.1
  • Component/s: Runtime
  • Labels:
    None
  • Number of attachments :
    0

Description

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.

Activity

Hide
David Grove added a comment -

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.

Show
David Grove added a comment - 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.
Hide
Ian Rogers added a comment -

Fix in r14915.

Show
Ian Rogers added a comment - Fix in r14915.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: