-
Bug
-
Resolution: Fixed
-
P2
-
5.0, 6, 6u7
-
b43
-
x86, sparc
-
linux, solaris_10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2176415 | 6u14 | Nikolay Gorshkov | P3 | Closed | Fixed | b06 |
JDK-2170675 | 6u13-rev | Nikolay Gorshkov | P2 | Resolved | Fixed | b07 |
JDK-2195810 | OpenJDK6 | Andrew Brygin | P3 | Resolved | Fixed | b21 |
JDK-2176570 | 5.0u19 | Nikolay Gorshkov | P3 | Closed | Fixed | b02 |
JDK-2170614 | 5.0u18-rev | Nikolay Gorshkov | P2 | Resolved | Fixed | b06 |
FULL PRODUCT VERSION :
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Any OS which exhibits Bug #4797189.
A DESCRIPTION OF THE PROBLEM :
Line 1228 of PNGImageReader creates a new Inflater and passes it into an InflaterInputStream:
is = new InflaterInputStream(is, new Inflater());
Inspection of the InflaterInputStream code reveals that this Inflater will never be "end"ed, even by a call to "close", causing a leak of memory as described in Bug #4797189.
A reference to the Inflater should be maintained and properly "end"ed in the "PNGImageReader .dispose" method.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached program to reproduce.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected normal heap usage.
ACTUAL -
Actual heap usage mimics that of Bug #4797189.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.imageio.ImageReadParam;
import javax.imageio.stream.FileImageInputStream;
import javax.imageio.stream.ImageInputStream;
import com.sun.imageio.plugins.png.PNGImageReader;
import com.sun.imageio.plugins.png.PNGImageReaderSpi;
public class Leak
{
public static void main(String[] args) throws Exception
{
while (true)
{
ImageInputStream stream = new FileImageInputStream(new File("image.png"));
PNGImageReader imageReader = new PNGImageReader(new PNGImageReaderSpi());
imageReader.setInput(stream);
imageReader.read(0, new ImageReadParam());
imageReader.dispose();
stream.close();
}
}
}
---------- END SOURCE ----------
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Any OS which exhibits Bug #4797189.
A DESCRIPTION OF THE PROBLEM :
Line 1228 of PNGImageReader creates a new Inflater and passes it into an InflaterInputStream:
is = new InflaterInputStream(is, new Inflater());
Inspection of the InflaterInputStream code reveals that this Inflater will never be "end"ed, even by a call to "close", causing a leak of memory as described in Bug #4797189.
A reference to the Inflater should be maintained and properly "end"ed in the "PNGImageReader .dispose" method.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached program to reproduce.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected normal heap usage.
ACTUAL -
Actual heap usage mimics that of Bug #4797189.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.imageio.ImageReadParam;
import javax.imageio.stream.FileImageInputStream;
import javax.imageio.stream.ImageInputStream;
import com.sun.imageio.plugins.png.PNGImageReader;
import com.sun.imageio.plugins.png.PNGImageReaderSpi;
public class Leak
{
public static void main(String[] args) throws Exception
{
while (true)
{
ImageInputStream stream = new FileImageInputStream(new File("image.png"));
PNGImageReader imageReader = new PNGImageReader(new PNGImageReaderSpi());
imageReader.setInput(stream);
imageReader.read(0, new ImageReadParam());
imageReader.dispose();
stream.close();
}
}
}
---------- END SOURCE ----------
- backported by
-
JDK-2170614 PNGImageReader leaks native memory through an Inflater.
- Resolved
-
JDK-2170675 PNGImageReader leaks native memory through an Inflater.
- Resolved
-
JDK-2195810 PNGImageReader leaks native memory through an Inflater.
- Resolved
-
JDK-2176415 PNGImageReader leaks native memory through an Inflater.
- Closed
-
JDK-2176570 PNGImageReader leaks native memory through an Inflater.
- Closed
- relates to
-
JDK-4797189 Finalizers not called promptly enough
- Closed
(1 relates to)