RFR (M): 8047328: Improve memory usage for cards in SparsePRTEntry

Mikael Gerdin mikael.gerdin at oracle.com
Mon May 9 14:33:51 UTC 2016


Hi Thomas,

On 2016-05-02 16:04, Thomas Schatzl wrote:
> Hi all,
>
>    can I have reviews for this change that cuts SparsePRTEntry usage by
> half (asymptotically at least :) )?
>
> This change is based on a change from A. Sjöberg (which will be
> credited by me), where instead of having special -1 entries in the
> SparsePRTEntry array of cards, use a dedicated next-pointer for storing
> where to put the next card.
>
> This allows us to internally use uint16_t's instead of CardIdx_t's
> (which are 32 bit) for storing.
>
> This also limits the max region size to 32M: there is an assert that
> checks that - unfortunately it is not possible to have a STATIC_ASSERT
> here, as HeapRegionBounds::MAX_REGION_SIZE is private.
> If you think that it is worth to have a static assert, at the cost of
> exposing that member (or has another idea on how to do that without
> adding too many dependencies somewhere), I would be happy to change the
> code accordingly.
>
> This reduces memory usage of sparse prt entries, and also somewhat
> speeds up searching and iterating entries.
>
> There are no significant throughput gains for that change though, but
> the memory savings (particularly on large heaps) are nice to have.
>
> (Even in the worst case, i.e. very small default number of cards in a
> SparsePRTEntry we are not worse than before in that regard).
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8047328
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8047328/webrev/

Looks ok to me.
/Mikael

> Testing:
> jprt, vm.gc, perf benchmarks
>
> Thanks,
>    Thomas
>



More information about the hotspot-gc-dev mailing list