RFR: 8320215: HeapDumper can use DumpWriter buffer during merge

Chris Plummer cjplummer at openjdk.org
Wed May 29 02:06:02 UTC 2024


On Fri, 19 Apr 2024 00:10:12 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> The fix updates HeapMerger to use writer buffer (no need to copy memory, also writer buffer is 1MB instead of 4KB).
> Additionally fixed small issue in FileWriter (looks like `ssize_t` instead of `size_t` is a typo, the argument should be unsigned)
> 
> Testing: all HeapDump-related tests on Oracle supported platforms

src/hotspot/share/services/heapDumper.cpp line 2137:

> 2135:   while ((cnt = segment_fs.read(_writer->buffer(), 1, _writer->buffer_size())) != 0) {
> 2136:     _writer->set_position(cnt);
> 2137:     _writer->flush();

Why flush on each iteration instead of just once after you are done with the loop?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18850#discussion_r1618079060


More information about the serviceability-dev mailing list