Review request: 8026391: The Metachunk header wastes memory - 8026392: Metachunks and Metablocks are using a too large alignment

Stefan Karlsson stefan.karlsson at oracle.com
Mon Oct 14 04:58:31 PDT 2013


Please, review these two patches to remove some of the wastages 
introduced in the metaspace.


8026391: The Metachunk header wastes memory
  http://cr.openjdk.java.net/~stefank/8026391/webrev.00/
  https://bugs.openjdk.java.net/browse/JDK-8026391

There are a couple of fields in Metachunk that store already known 
information, like the beginning and the end of the Metachunk. I replaced 
those fields with code instead.

To make this easier, I extracted some duplicated code in Metablock and 
Metachunk into a super class named Metamem. The extracted code is purely 
needed to allow these objects to be placed on the FreeList and in the 
BinaryTreeDictionary.


8026392: Metachunks and Metablocks are using a too large alignment
  http://cr.openjdk.java.net/~stefank/8026392/webrev.00/
  https://bugs.openjdk.java.net/browse/JDK-8026392

The metaspace code was using ARENA_ALIGN to align the Metablocks and 
Metachunk header. This forced all allocations of metadata to be 16 bytes 
aligned. This patch patch changes the restriction to be 8 bytes instead, 
since that's the restriction needed for 64 bit types like long, double, 
pointers and klass pointers,


Testing: Added unit test for Metachunk. JPRT (before splitting of the 
patches)

thanks,
StefanK


More information about the hotspot-dev mailing list