RFR: 8257234 : Add gz option to SA jmap to write a gzipped heap dump [v10]

Chris Plummer cjplummer at openjdk.java.net
Wed Jan 27 06:54:45 UTC 2021


On Wed, 27 Jan 2021 06:38:02 GMT, Lin Zang <lzang at openjdk.org> wrote:

>> 8257234 : Add gz option to SA jmap to write a gzipped heap dump
>
> Lin Zang has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - update copyright info
>  - fix commandline argument issue and refine test cases

test/lib/jdk/test/lib/hprof/parser/Reader.java line 152:

> 150:                 File out = new File(deCompressedFile);
> 151:                 try {
> 152:                     //GZIPOutputStream

I'm not sure why this comment is here. It's not very useful.

test/lib/jdk/test/lib/hprof/parser/Reader.java line 172:

> 170:                     }
> 171:                 } catch (Exception e) {
> 172:                     throw new IOException("Can not decompress the compressed hprof file");

`e` should be passed to the `IOException` constructor for the `cause` argument.

test/lib/jdk/test/lib/hprof/parser/Reader.java line 155:

> 153:                     GZIPInputStream gis = new GZIPInputStream(new FileInputStream(heapFile));
> 154:                     FileOutputStream fos = new FileOutputStream(out);
> 155:                     byte[] buffer = new byte[1 << 20];

`1024 * 1024` is more readable than `1 << 20`

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

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


More information about the serviceability-dev mailing list