United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6734186 Native memory leak in java.util.zip.Deflater / thread saftey
JDK-6734186 : Native memory leak in java.util.zip.Deflater / thread saftey

Details
Type:
Bug
Submit Date:
2008-08-06
Status:
Closed
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2010-10-29
Component:
core-libs
OS:
linux
Sub-Component:
java.util.jar
CPU:
x86
Priority:
P4
Resolution:
Cannot Reproduce
Affected Versions:
5.0
Fixed Versions:

Related Reports
Relates:

Sub Tasks

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

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

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



Hardware and Software, Engineered to Work Together