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

Lin Zang lzang at openjdk.java.net
Mon Oct 26 03:23:37 UTC 2020


On Thu, 22 Oct 2020 08:30:09 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Lin Zang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.
>
> src/hotspot/share/gc/parallel/psOldGen.cpp line 199:
> 
>> 197: 
>> 198:   // iterate objects in block.
>> 199:   HeapWord* end = MIN2(top, begin + _iterate_block_size);
> 
> `_iterate_block_size` is a size in bytes (or at least you use it like a size in bytes when calculating the number of blocks), so before you can add it you need to convert it to a size in words like this:
> 
> Suggestion:
> 
>   size_t block_word_size = _iterate_block_size / HeapWordSize;
>   HeapWord* begin = bottom + block_index * block_word_size;
>  
>   assert((block_word_size % (ObjectStartArray::block_size)) == 0,
>           "BLOCK SIZE not a multiple of start_array block");
>  
>   // iterate objects in block.
>   HeapWord* end = MIN2(top, begin + block_word_size);

Nice catch!, Paul mentioned it in previous review, I missed to update it.

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

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


More information about the serviceability-dev mailing list