On Thu, 16 Sep 2021 15:44:46 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:
>> Lin Zang has updated the pull request with a new target base due to a merge >> or a rebase. The pull request now contains ten commits: >> >> - Merge branch 'master' into hprof >> - code clean up and refinement >> - Merge branch 'master' into hprof >> - make calculateGlobalJNIHandlesDumpRecordSize abstract >> - code clean up and remove useless methods >> - Merge branch 'master' into hprof >> - fix write size issue >> - Merge branch 'master' into hprof >> - 8269685: Optimize HeapHprofBinWriter implementation > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java > line 642: > >> 640: @Override >> 641: protected void writeHeapRecordPrologue(int size) throws IOException >> { >> 642: if (size == 0 || (currentSegmentStart > 0)) { > > Formatting nit: There is no need in internal brackets `()` around > `currentSegmentStart > 0`. > Is it possible that `currentSegmentStart > 0` in the > `writeHeapRecordPrologue`? > If it is not expected then it is worth to consider adding an assert instead > of this sub-condition. Hi Serguei, The currentSegmentStart here could be non-zero when useSegmentHeapDump is false. so we need to check it here. Thanks! ------------- PR: https://git.openjdk.java.net/jdk/pull/4666