JDK-8252187 : Optimize freeblocks storage in MetaspaceArena after JEP387
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • Submitted: 2020-08-22
  • Updated: 2021-07-09
  • Resolved: 2021-07-09
Related Reports
Relates :  
Description
Optimization after JEP387 hits mainline (we do not want it right now since we want to stabilize the patch):

<quote>

blocktree.hpp/cpp should be blockTree.hpp/cpp

Since for class metaspace, the reclaimed InstanceKlass are generally
bigger than the largest BinList size, maybe class type MetaspaceArenas
should only have a blockTree and not a SmallBlocks, so not the whole
freeList.hpp structure.  I think we could do some footprint analysis
with NMT and see if this might help.  It's fairly rare unless you have a
lot of redefinition.  I don't think this should be changed in this
change though.


Oh good point.

I would not like to hard-code the assumption that class space only contains Klass though; I dimly remember an RFR with Ioi where he tried storing other things there as well. IIRC he found some other solution. But my point is that this assumption is fragile.

But a "soft assumption" would be fine. E.g. creating the BinList on the fly, only when needed, and separately from the blocktree. Easy to implement too.

We don't need NMT to analyze. BinList currently has 32 slots, + counter + mask. We pay 272 bytes per structure, or 34 words. Which we would save per CLD.

</quote>
Comments
I lack the time to do this right now. If needed, lets re-open it.
09-07-2021