RFR: 8305062: Refactor CardTable::resize_covered_region

Thomas Schatzl tschatzl at openjdk.org
Mon Apr 17 15:25:40 UTC 2023


On Mon, 17 Apr 2023 14:31:14 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/cardTable.cpp line 77:
>> 
>>> 75:   _byte_map_base(nullptr),
>>> 76:   _covered(MemRegion::create_array(_max_covered_regions, mtGC)),
>>> 77:   _committed(MemRegion::create_array(_max_covered_regions, mtGC)),
>> 
>> Is it useful any more to dynamically create the `_committed` and `_covered` `MemRegions`? These are fixed size anyway. Also the code unconditionally allocates them even if not both are used. It seems to be a win to just statically allocate them.
>
> `_covered` and `_committed` are also referenced in `vmStructs_gc.hpp`. I can use `MemRegion _covered[2];` inside `class CardTable`, but how to represent that array-type in `vmStructs_gc.hpp`?

They are not used in the hotspot agent afaict though, so they could simply be removed.

Otherwise one could use two separate members of `MemRegion` type.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13206#discussion_r1168894038


More information about the hotspot-gc-dev mailing list