-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b53
-
generic
-
generic
-
Verified
I am running an application which writes each of the buffered images into a file using a GIF Writer. I am looping through all the buffered image types and all the output types such as File, FileCacheIOS, MemCacheIOS, RAF, etc. When I choose USHORT GRAY buffered image type, I am getting an OutOfMemoryError in the console.
Here is the exception:
java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:113)
at java.util.ArrayList.<init>(ArrayList.java:120)
at javax.imageio.metadata.IIOMetadataNode.<init>(IIOMetadataNode.java:308)
at com.sun.imageio.plugins.gif.GIFImageMetadata.getNativeTree(GIFImageMetadata.java:154)
at com.sun.imageio.plugins.gif.GIFImageMetadata.getAsTree(GIFImageMetadata.java:110)
at com.sun.imageio.plugins.gif.GIFImageWriter.convertMetadata(GIFImageWriter.java:300)
at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:588)
at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:499)
at GIFWriterUshortTest.writeBufferedImage(GIFWriterUshortTest.java:122)
at GIFWriterUshortTest.itemStateChanged(GIFWriterUshortTest.java:57)
at java.awt.Choice.processItemEvent(Choice.java:610)
at java.awt.Choice.processEvent(Choice.java:577)
at java.awt.Component.dispatchEventImpl(Component.java:4360)
at java.awt.Component.dispatchEvent(Component.java:4194)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:592)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:270)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:198)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:171)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:166)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:158)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:119)
This is reproducible on all mustang builds that has GIF Writer feature. This is not reproducible for any other image writers. This is reproducible on all platforms. I monitored the application with Jconsole and noticed that the mem consumption goes as high as 70MB when using USHORT GRAY buffered image.
I have attached a sample test. Execute the sample test. You would see a choice having all buffered image types. Choose the items 1 by 1 and the corresponding images will be loaded onto the frame. When you are choosing USHORT_GRAY, you will notice the above exception on the console. I am using the default memory settings for the JVM.
###@###.### 2005-07-06 10:21:05 GMT
Here is the exception:
java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:113)
at java.util.ArrayList.<init>(ArrayList.java:120)
at javax.imageio.metadata.IIOMetadataNode.<init>(IIOMetadataNode.java:308)
at com.sun.imageio.plugins.gif.GIFImageMetadata.getNativeTree(GIFImageMetadata.java:154)
at com.sun.imageio.plugins.gif.GIFImageMetadata.getAsTree(GIFImageMetadata.java:110)
at com.sun.imageio.plugins.gif.GIFImageWriter.convertMetadata(GIFImageWriter.java:300)
at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:588)
at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:499)
at GIFWriterUshortTest.writeBufferedImage(GIFWriterUshortTest.java:122)
at GIFWriterUshortTest.itemStateChanged(GIFWriterUshortTest.java:57)
at java.awt.Choice.processItemEvent(Choice.java:610)
at java.awt.Choice.processEvent(Choice.java:577)
at java.awt.Component.dispatchEventImpl(Component.java:4360)
at java.awt.Component.dispatchEvent(Component.java:4194)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:592)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:270)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:198)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:171)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:166)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:158)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:119)
This is reproducible on all mustang builds that has GIF Writer feature. This is not reproducible for any other image writers. This is reproducible on all platforms. I monitored the application with Jconsole and noticed that the mem consumption goes as high as 70MB when using USHORT GRAY buffered image.
I have attached a sample test. Execute the sample test. You would see a choice having all buffered image types. Choose the items 1 by 1 and the corresponding images will be loaded onto the frame. When you are choosing USHORT_GRAY, you will notice the above exception on the console. I am using the default memory settings for the JVM.
###@###.### 2005-07-06 10:21:05 GMT
- duplicates
-
JDK-6286578 GIF Writer writes RGB image in gray scale when def img metadata is specified
- Closed
- relates to
-
JDK-6324581 PIT: Animated GIF images are colored differently when created from opaque PNG/JPG image frames
- Closed