On Tue, 19 Jan 2021 21:38:28 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
>> Lin Zang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> code refine > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java > line 490: > >> 488: hprofBufferedOut = null; >> 489: } >> 490: > > Can you explain what this check is for and why it is no longer needed? The check here is to control the segment size. It checks whether the current segment is too large, if yes, it fills the segment size slot in fillInHeapRecordLength() and set currentSegmentStart = 0, meaning to create a new segment for following data write. And thanks to point it out, there should be a similar control logic in exitSegmentMode(), otherwise there is possibility of super huge segment. ------------- PR: https://git.openjdk.java.net/jdk/pull/1712