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

Marcus Hirt marcus.hirt at oracle.com
Fri Jul 20 11:28:06 UTC 2018


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