JDK-6734186 : Native memory leak in java.util.zip.Deflater / thread saftey
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: linux
  • CPU: x86
  • Submitted: 2008-08-06
  • Updated: 2011-02-16
  • Resolved: 2010-10-29
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Ubuntu 7.10

A DESCRIPTION OF THE PROBLEM :
There is a thread safety problem in the java.util.zip.Deflater native code, which leads to a native memory leak on systems with many processors (seen here on systems with 4 or more) which have many threads using the Deflater in parallel.

You are likely going to try to dismiss this bug as a duplicate of
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4797189
but it is fact, not.

In digging through the various bug reports relating to that old, unfixed bug, I believe other folks have also run into this issue.

This thread:
http://www.jfree.org/phpBB2/viewtopic.php?t=25298

Shows an example (with code) which shows this occurring on systems where the proper workaround for the other leak has been implemented - but the leak is only visible when the Deflater code is exercised in parallel.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use the Deflater in parallel (2 + threads) on a system 2+ processors.

Observe native memory leak.


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Single thread all access to the Deflater.

Comments
EVALUATION Submitter reported the problem is no longer reproducible in 6u14. Closed as "not reproducible" in latest build.
29-10-2010

EVALUATION It would be wonderful if the submitter could provide a testcase which demonstrates the problem, especially one that does not involve PNG code.
06-08-2008