JDK-6223075 : java.util.zip stream classes do not close default {De,In}flaters
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 1.3.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-01-28
  • Updated: 2010-04-02
  • Resolved: 2005-04-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.3.1_16 b01Fixed
Related Reports
Relates :  
Relates :  
Description
The fix for 4499542 was backported from 1.4 to 1.3.1_04, but the backport was
incomplete.  The usesDefaultDeflater field is never set, so the close() method
never invokes the underlying deflater's end() method.  This causes native
memory to be retained until the deflater is finalized.  Since finalization is
never guaranteed, native OutOfMemoryErrors can occur under heavy load.

This bug only exists in 1.3.1.

###@###.### 2005-1-28 20:22:26 GMT

Comments
EVALUATION This bug is also present in the {GZIP,Zip}{In,Out}putStream constructors, which also need to set the (package-private) usesDefault{De,In}flater fields in the parent {De,In}flaterOutputStream classes. This part of this bug was fixed in 1.4.1 as 4622045, but that fix was never backported to 1.3.1. In the case of GZIPOutputStream, this bug may be the root cause of 5072161. ###@###.### 2005-2-07 04:51:13 GMT
07-02-2005

SUGGESTED FIX --- /tmp/scdiff.LN2aDh/IR6TXg 2002-03-20 20:39:36.000000000 -0800 +++ src/share/classes/java/util/zip/DeflaterOutputStream.java 2005-01-23 12:31:29.000000000 -0800 @@ -68,6 +68,7 @@ */ public DeflaterOutputStream(OutputStream out) { this(out, new Deflater()); + usesDefaultDeflater = true; } ###@###.### 2005-1-28 20:22:26 GMT
28-01-2005