On Thu, 16 Sep 2021 15:58:24 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 654: > >> 652: out.writeInt(0); >> 653: // record position of the length slot >> 654: currentSegmentStart = fos.getChannel().position(); > > The comment before this line is confusing: the `currentSegmentStart` is not > the length. > Should this comment be moved after the line 653? Hi Serguei, Here it gets the file position and record it as the start point of data written, this record would be used later for calculate the data written size which would be written in the file. I will update the comment. ------------- PR: https://git.openjdk.java.net/jdk/pull/4666