RFR: 8252103: Parallel heap inspection for ParallelScavengeHeap [v12]

Lin Zang lzang at openjdk.java.net
Wed Nov 4 09:01:58 UTC 2020


On Wed, 4 Nov 2020 08:26:54 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Thanks Albert! Correct, the OldGen part will be revisit much for frequently.  do you have any clue to optimize this? I was considering the marco like "likely()" but I am not sure whether it is acceptable for hotspot.
>
> I think readability is the issue here; below is my attempt with the new `claim_and_get_block`. Don't think there's any performance diff though.
> 
>         
> size_t block_index = claimer->claim_and_get_block();
> if (block_index == HeapBlockClaimer::EdenIndex) {
>   young_gen()->eden_space()->object_iterate(cl);
>   block_index = claimer->claim_and_get_block();
> }
> if (block_index == HeapBlockClaimer::SurvivorIndex) {
>   young_gen()->from_space()->object_iterate(cl);
>   young_gen()->to_space()->object_iterate(cl);
>   block_index = claimer->claim_and_get_block();
> }
> while (block_index != HeapBlockClaimer::InvalidIndex) {
>   old_gen()->object_iterate_block(cl, block_index - HeapBlockClaimer::NumNonOldGenClaims);
>   block_index = claimer->claim_and_get_block();
> }
>         
> PS: I didn't test the code, so please take it as a quick sketch.

Hi Albert, 
Thanks for suggestion and I get your point. I have a little concern with this change:  it presumes that EdenIndex and SurvivorIndex are fix to be valued as the begining of the indices (0 and 1), otherwise there are chances that youngGen may never get iterated. I am not sure whether this assumption should be kept (or at least add the info in comments?) , although the current implementation of using size_t for indices follows the assumption.

Thanks,
Lin

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

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


More information about the hotspot-gc-dev mailing list