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
Tue Oct 15 11:11:24 PDT 2013
From an offline discussion with Jon, I decided to change the following:
$ hg diff
diff -r 8e2b57a0132c src/share/vm/memory/metachunk.cpp
--- a/src/share/vm/memory/metachunk.cpp Tue Oct 15 14:32:20 2013 +0200
+++ b/src/share/vm/memory/metachunk.cpp Tue Oct 15 20:07:51 2013 +0200
@@ -37,8 +37,8 @@
// so that 64 bit types get correctly aligned.
const size_t alignment = 8;
+ // Make sure that the Klass alignment also agree.
STATIC_ASSERT(alignment == (size_t)KlassAlignmentInBytes);
- STATIC_ASSERT(alignment == (size_t)BytesPerLong);
return alignment;
}
StefanK
On 10/14/13 1:58 PM, Stefan Karlsson wrote:
> 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