[PATCH] JDK-8176571: Fine bitmaps should be allocated as belonging to mtGC

Thomas Schatzl thomas.schatzl at oracle.com
Mon May 22 15:23:12 UTC 2017


Hi Milan,

  first, thanks for your contribution! :)

Some procedural points: we would need you to sign a contributor
agreement if you are not covered yet in some way to be able to take
your contributions.

See the FAQ [1] and the form itself [2].

On Mon, 2017-05-22 at 06:35 +0000, Milan Mimica wrote:
> Just fixing the subject
> 
> From: hotspot-gc-dev <hotspot-gc-dev-bounces at openjdk.java.net> on
> behalf of Milan Mimica <Milan.Mimica at infobip.com>
> Sent: Sunday, May 21, 2017 13:12
> To: hotspot-gc-dev at openjdk.java.net
> Subject: RFR(XS) JDK-8176571:
>  
> Hello
> 
> Here is my attempt to fix https://bugs.openjdk.java.net/browse/JDK-81
> 76571. The same applies to jdk9 and 10.
> It changes the NMT category of CHeapBitMap which is used only in G1
> code. Given that the class is defined in "share" scope, and it may be
> used elsewhere in the future, perhaps it should be made made a
> template? That will add more boilerplate code to g1 sources.

It is a bit awkward to have a generic utility class to always report
everything as belonging to GC :-)

We actually discussed this a little internally, and think that adding a
template parameter would pull out a lot of code from the cpp files into
the header files. As we kind of try to hide implementation as much as
possible, such a change would work against that goal.

There is another option, having an additional field in CHeapBitmap that
indicates from what pool the memory should be assigned to.
>From a memory POV that additional (4-byte) member should be zero-cost
for the remembered sets due to padding (see class PerRegionTable in
heapRegionRemSet.cpp, immediately after the CHeapBitmap there is an
int-sized member followed by a pointer).

(All other CHeapBitmap are typically very large or very rare that it
does not matter).

What do you think?

> 
> --- old/src/share/vm/utilities/bitMap.cpp    2017-05-21
> 13:09:15.350905240 +0200
> +++ new/src/share/vm/utilities/bitMap.cpp    2017-05-21
> 13:09:15.286905238 +0200
> @@ -48,10 +48,10 @@
>  class CHeapBitMapAllocator : StackObj {
>   public:
>    bm_word_t* allocate(size_t size_in_words) const {
> -    return ArrayAllocator<bm_word_t,
> mtInternal>::allocate(size_in_words);
> +    return ArrayAllocator<bm_word_t, mtGC>::allocate(size_in_words);
>    }
>    void free(bm_word_t* map, idx_t size_in_words) const {
> -    ArrayAllocator<bm_word_t, mtInternal>::free(map, size_in_words);
> +    ArrayAllocator<bm_word_t, mtGC>::free(map, size_in_words);
>    }
>  };
> Milan Mimica, Senior Software Engineer / Division Lead
> 

Thanks,
  Thomas


[1] http://www.oracle.com/technetwork/oca-faq-405384.pdf
[2] http://www.oracle.com/technetwork/oca-405177.pdf



More information about the hotspot-gc-dev mailing list