Excessive Heap Consumption in com.sun.imageio.plugins.jpeg.JPEGImageWriter using OpenJDK
Environment
- Red Hat Enterprise Linux
- 5
- 6
- OpenJDK
- java-1.6.0-openjdk-1.6.0.0-1.41.1.11.11.90.el5_9
- java-1.6.0-openjdk-1.6.0.0-1.61.1.11.11.el6_4.x86_64
Issue
- After upgrading to java-1.6.0-openjdk-1.6.0.0-1.61.1.11.11.el6_4.x86_64, Java applications are consuming more memory (specifically int[] objects allocated by com.sun.imageio.plugins.jpeg.JPEGImageWriter), without releasing it.
- It throws a OOME Heap Size Exception. How to fix it?
Resolution
- RHBA-2013:1741-1
- For RHEL 6, upgrade to java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6+
- For RHEL 5, upgrade to java-1.6.0-openjdk-1.6.0.0-1.42.1.11.14.el5_10+
Root Cause
Diagnostic Steps
Steps to Reproduce:
- Compile and run Prueba.java (attached in bz)
- Use the following VM parameter: *-Xmx64m *
- Use the following Program Parameter: 1000
Actual results:
It throws a OOME Heap Size Exception
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.