RFR JMC-6086: Unreleased stream when we reach end of decoding in StreamChunkIterator

Marcus Hirt marcus.hirt at oracle.com
Sat Jul 21 11:54:24 UTC 2018


Looks good! 

/M

- Excuse me if terse; sent from my phone.

> On 21 Jul 2018, at 11:34, Jayathirth D V <jayathirth.d.v at oracle.com> wrote:
> 
> Hi Marcus,
> 
> Thanks for your inputs.
> It's good to know that we have IO utility.
> 
> Please find updated webrev for review:
> http://cr.openjdk.java.net/~jdv/6086/webrev.01/ 
> 
> Thanks,
> Jay
> 
> -----Original Message-----
> From: Marcus Hirt 
> Sent: Friday, July 20, 2018 4:58 PM
> To: Jayathirth D V; jmc-dev at openjdk.java.net
> Subject: Re: RFR JMC-6086: Unreleased stream when we reach end of decoding in StreamChunkIterator
> 
> Hi Jay,
> 
> May I suggest instead doing:
> 
>            if (!hasNext) {
>                IOToolkit.closeSilently(inputStream);
>            }
> 
> /M
> 
> On 2018-07-20, 10:55, "jmc-dev on behalf of Jayathirth D V" <jmc-dev-bounces at openjdk.java.net on behalf of jayathirth.d.v at oracle.com> wrote:
> 
>    Hello All,
> 
> 
> 
>    Please review the following fix in JMC 7 :
> 
> 
> 
>    Bug : https://bugs.openjdk.java.net/browse/JMC-6086 
> 
>    Webrev : http://cr.openjdk.java.net/~jdv/6086/webrev.00/ 
> 
> 
> 
>    Issue: When we try to read compressed JFR file in ChunkReader, we use StreamChunkIterator and store the decoded stream. But when we reach end of stream we are not releasing the open stream.
> 
> 
> 
>    Solution: Close the open stream when we reach end of file.
> 
> 
> 
>    Ran unit tests and there are no failures. Also there are no problems with JDK 7/8/9/10/11 automated analysis results.
> 
> 
> 
>    Thanks,
> 
>    Jay
> 
> 
> 
> 
> 
> 



More information about the jmc-dev mailing list