On Mon, 19 Oct 2020 13:09:34 GMT, Lin Zang <lz...@openjdk.org> wrote:

>> - Parallel heap iteration support for PSS
>> - JBS:  https://bugs.openjdk.java.net/browse/JDK-8252103
>
> 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.

Took a second look today and found two additional problems. 

I would also be interested in what kind of testing you've done with this patch.

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);

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

Changes requested by sjohanss (Reviewer).

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

Reply via email to