Details
Description
Opening and closing a large number of bzip2-compressed input streams causes the process to be killed on OutOfMemory when using the native bzip2 library.
Our initial analysis suggests that this can be caused by DecompressorStream overriding the close() method, and therefore skipping the line from its parent: CodecPool.returnDecompressor(trackedDecompressor). When the decompressor object is a Bzip2Decompressor, its native end() method is never called, and the allocated memory isn't freed.
If this analysis is correct, the simplest way to fix this bug would be to replace in.close() with super.close() in DecompressorStream.