RFR: JDK-8264987: G1: Fill BOTs for Survivor-turned-to-Old regions in full gc

Stefan Johansson sjohanss at openjdk.java.net
Tue Apr 13 12:36:32 UTC 2021


On Tue, 13 Apr 2021 12:28:27 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> in JDK-8262068, we have an enhancement for full gc which will skip compacting some regions with high survivor ratio. There might be some young regions among these skipped regions. These young regions are not filled with BOTs info as they're young.
>> But after full GC these young regions will become old regions, and the BOTs info is better to be filled for performance consideration.
>
> src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp line 190:
> 
>> 188:   }
>> 189:   assert(next_addr == limit, "Should stop the scan at the limit.");
>> 190: }
> 
> I think this could be implemented using `apply_to_marked_objects()`. Let the closure keep track of the threshold for the region and the `apply()` function could look something like this:
> 
> size_t apply(oop object) {
>   size_t size = object->size();
>   HeapWord* addr = cast_from_oop<HeapWord*>(object);
>   HeapWord* next_addr = addr + size;
>   if (next_addr > _threshold) {
>     _threshold = hr->cross_threshold(addr, next_addr);
>   }
>   return size;
> }

I realize that we need to keep the previous address in the closure as well, for the case when we step over the threshold because of an unmarked object.

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

PR: https://git.openjdk.java.net/jdk/pull/3459



More information about the hotspot-gc-dev mailing list