Project

General

Profile

Bug #4544

Elog thumbnail generator has trouble handling large jpeg files

Added by Kyle Hazelwood over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
High
Category:
Server
Target version:
-
Start date:
08/14/2013
Due date:
% Done:

0%

Estimated time:
Duration:

Description

Entry 2930 has a 7.55 MB image attached. The elog uses ImageIO.read(InputStream) to read the file byte data from the db. The bufferedimage created is many times larger than 7.5 MB because it decompresses the jpeg image.

The following exception occurs:
Exception in thread "http-bio-8443-exec-9821" java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:58)
at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:397)
at java.awt.image.Raster.createWritableRaster(Raster.java:938)
at javax.imageio.ImageTypeSpecifier.createBufferedImage(ImageTypeSpecifier.java:1056)
at javax.imageio.ImageReader.getDestination(ImageReader.java:2879)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:980)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:948)
at javax.imageio.ImageIO.read(ImageIO.java:1422)
at javax.imageio.ImageIO.read(ImageIO.java:1326)
at gov.fnal.controls.webapps.Elog.ElogServlet.getFileThumbnail(ElogServlet.java:1421)
at gov.fnal.controls.webapps.Elog.ElogServlet.doGet(ElogServlet.java:584)

After server restart the exception hasn't occured again making me think that it is a cummulative heap space problem opposed to the first access causing the heap memory issue. So it may be that ImageIO.read() can handle that large of a jpeg but that the bufferedimage or inputstream is not being garbage collected properly. However, if GC is working fine then I need to increase the allocatable heap space on the elog server jvm or change the way I'm creating thumbnails.


Related issues

Related to Elog - Bug #7907: Elog crash on java out of heap memoryClosed02/19/2015

History

#1 Updated by Kyle Hazelwood almost 6 years ago

  • Related to Bug #7907: Elog crash on java out of heap memory added

#2 Updated by Kyle Hazelwood almost 6 years ago

  • Status changed from New to Closed

Also available in: Atom PDF