[Geoserver-devel] [jira] (GEOS-6053) Serving JPEG WorldImage causes OutOfMemory-Errors in Tomcat 7 on 64 bit Linux

A. Walter created BugGEOS-6053
Serving JPEG WorldImage causes OutOfMemory-Errors in Tomcat 7 on 64 bit Linux

Issue Type:

BugBug

Affects Versions:

2.4.0, 2.3.2

Assignee:

Andrea Aime

Attachments:

geoserver.log.demo, Pk50095.jgw, Pk50095.JPG, Pk50095.prj

Created:

26/Sep/13 2:50 AM

Description:

When trying to serve tiles from a JPEG WorldImage with GeoServer, the heap space of its Tomcat container continuously fills up until Tomcat (and, relatedly, GeoServer) become sluggish/unresponsive, reporting OOM errors and problems with a JPEG library. The only way to solve this situation is restarting Tomcat.

How to reproduce:

  • Create a WorldImage store for a JPEG WorldImage in GeoServer and publish the WorldImage as a layer. (Sample data is attached for convenience - it’s a JPEG WorldImage created from the sample TIF WorldImage provided with GeoServer. We experience this problems with other JPEG WorldImages as well.)
  • Go to GeoServer’s LayerPreview and preview the layer (setting tiled to true to create more requests). Pan and zoom for a bit (just create lots of requests for the layer’s tiles).
  • Watch Tomcat’s heap space (you can easily see it in the Tomcat Manager Web App -> Server Status). PS Old Gen will continuosly fill up to 99 %, PS Eden Space will fill up as well to 90 - 99 % while PS Survivor Space is at 0 %.
  • When the Tomcat heap is almost completely filled up, Tomcat and GeoServer will become sluggish/unresponsive. The Tomcat Server Status page shows several threads with requests for the layer’s tiles “hanging” in state “Service”. GeoServer will stop serving the layer’s tiles (but tiles from the integrated GWC will still be served). Errors show up in the GeoServer log (see attached example log), look for:
    -> ERROR [geoserver.ows] - java.lang.OutOfMemoryError: Java heap space
    -> ERROR [geoserver.ows] - java.lang.RuntimeException: javax.imageio.IIOException: Improper call to JPEG library in state 202
    -> ERROR [geotools.map] - Call MapContent dispose() to prevent memory leaks
    -> ERROR [geoserver.ows] - java.lang.OutOfMemoryError: GC overhead limit exceeded

The problem can be reliably reproduced on our system (see environment information) with the listed steps. We tried GeoServer versions 2.3.2 and 2.2.2 (with the rest of the environment unchanged) and encountered the problem as well.

We seem to be unable to reproduce the problem on an older system (Linux 2.6.18-348.el5 i386 (32 bit), Apache Tomcat/6.0.26 (742.43 MB max memory), JVM Sun Microsystems Inc.: 1.6.0_20 (Java HotSpot™ Client VM), GeoServer 2.2.2 ). The problem therefore appears to be environment dependent, but we are not sure what exactly causes the difference in behaviour.

Possible Workaround:

We were unable to reproduce this problem when serving TIF WorldImages. Therefore, our current workaround is converting the JPEG image to an TIF, renaming the JGW-Worldfile to TFW and serving this TIF WorldImage with GeoServer.

Environment:

OS: Linux 2.6.32-358.11.1.el6.x86_64 (64 Bit)

JVM: Oracle Corporation: 1.7.0_25 (Java HotSpot™ 64-Bit Server VM)

Apache Tomcat/7.0.40 - Max memory: 1287.12 MB, Max PS Old Gen: 965 MB, Max PS Eden Space: 381 MB

GeoServer: 2.4.0 (happens with 2.2.2 and 2.3.2 as well), no native JAI installed

Project:

GeoServer

Priority:

MinorMinor

Reporter:

A. Walter

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)