RFR: 8332490: JMH org.openjdk.bench.java.util.zip.InflaterInputStreams.inflaterInputStreamRead OOM [v2]
Jaikiran Pai
jpai at openjdk.org
Wed May 22 07:49:28 UTC 2024
On Wed, 22 May 2024 07:27:14 GMT, Claes Redestad <redestad at openjdk.org> wrote:
>> test/micro/org/openjdk/bench/java/util/zip/InflaterInputStreams.java line 113:
>>
>>> 111: try (InflaterInputStream iis = new InflaterInputStream(deflated)) {
>>> 112: while (iis.read(inflated, 0, inflated.length) != -1);
>>> 113: }
>>
>> Presumably this only works because closing the underlying stream (a BAIS in this case) is a no-op.
>
> Yes, the underlying BAIS can be repeatedly closed without affecting the benchmark.
Hello Alan, before this change, the memory gets occupied by too many of these:
1: 10871820 521847360 jdk.internal.ref.CleanerImpl$PhantomCleanableRef (java.base at 23-internal)
2: 10871758 260922192 java.util.zip.Inflater$InflaterZStreamRef (java.base at 23-internal)
Closing the `InflaterInputStream` releases those underlying `InflaterZStreamRef`s.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19340#discussion_r1609461029
More information about the core-libs-dev
mailing list