[Geoserver-devel] [JIRA] (GEOS-10414) OutOfMemoryError on WMS 1.3.0 GetMap requests with wrong CRS

Janis Wojtusch created an issue

GeoServer / BugGEOS-10414

OutOfMemoryError on WMS 1.3.0 GetMap requests with wrong CRS

Issue Type:

BugBug

Affects Versions:

2.20.2, 2.20.3

Assignee:

Unassigned

Components:

WMS

Created:

09/Mar/22 10:47 AM

Environment:

The issue could be observed on the following setups:

  • GeoServer 2.20.2 on Tomcat 9.0.58 (4 cores, 8 GiB memory, -Xms1984M -Xmx3969M)
  • GeoServer 2.20.3 on Tomcat 9.0.58 (2 cores, 4 GiB memory, -Xms976M -Xmx1953M)
  • GeoServer 2.20.3 on Tomcat 9.0.59 (4 cores, 8 GiB memory, -Xms1984M -Xmx3969M)

The GeoPackage test file was taken from NGA GeoPackage Libraries:
https://github.com/ngageoint/GeoPackage/blob/master/docs/examples/rivers.gpkg

Priority:

HighHigh

Reporter:

Janis Wojtusch

There seems to be an issue when WMS 1.3.0 GetMap requests contain a bounding box with EPSG:3857 coordinates but set the CRS to EPSG:4326 and the data store is a GeoPackage file. For large areas, this results in an OutOfMemoryError: Java heap space which requires a restart of the server. WMS 1.1.1 GetMap requests do not seem to be affected.

The issue was observed under the following conditions:

  • GeoServer 2.20.3 as WebArchive on Tomcat 9.0.59
  • WMS version 1.3.0
  • Layers in a GeoPackage data store
  • GetMap request with a large bounding box in EPSG:3857 coordinates and CRS set to EPSG:4326

Example request that triggered the issue on our test setup:
http://localhost:8080/geoserver/river/wms?service=WMS&version=1.3.0&request=GetMap&layers=river%3Arivers&bbox=-6011097,2631938,6010897,13852635&crs=EPSG%3A4326&width=800&height=600&format=image%2Fpng

Tomcat logs the following stack trace:

java.lang.OutOfMemoryError: Java heap space
        at org.geotools.geometry.jts.LiteCoordinateSequence.getCoordinateInternal(LiteCoordinateSequence.java:176)
        at org.locationtech.jts.geom.impl.PackedCoordinateSequence.getCoordinate(PackedCoordinateSequence.java:97)
        at org.locationtech.jts.geom.LineString.getCoordinateN(LineString.java:95)
        at org.locationtech.jts.geom.LineString.isClosed(LineString.java:145)
        at org.locationtech.jts.geom.LinearRing.validateConstruction(LinearRing.java:90)
        at org.locationtech.jts.geom.LinearRing.<init>(LinearRing.java:86)
        at org.locationtech.jts.geom.GeometryFactory.createLinearRing(GeometryFactory.java:380)
        at org.geotools.geometry.jts.LiteCoordinateSequence.cloneGeometry(LiteCoordinateSequence.java:378)
        at org.geotools.geometry.jts.LiteCoordinateSequence.cloneGeometry(LiteCoordinateSequence.java:324)
        at org.geotools.geometry.jts.LiteCoordinateSequence.cloneGeometry(LiteCoordinateSequence.java:310)
        at org.geotools.geometry.jts.LiteCoordinateSequence.cloneGeometry(LiteCoordinateSequence.java:392)
        at org.geotools.geometry.jts.LiteCoordinateSequence.cloneGeometry(LiteCoordinateSequence.java:314)
        at org.geotools.geometry.jts.LiteCoordinateSequence.cloneGeometry(LiteCoordinateSequence.java:320)
        at org.geotools.geometry.jts.LiteShape2.<init>(LiteShape2.java:124)
        at org.geotools.geometry.jts.LiteShape2.<init>(LiteShape2.java:99)
        at org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:3081)
        at org.geotools.renderer.lite.StreamingRenderer.processFeature(StreamingRenderer.java:2889)
        at org.geotools.renderer.lite.StreamingRenderer.drawPlain(StreamingRenderer.java:2664)
        at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:2284)
        at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:917)
        at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:545)
        at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:205)
        at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:82)
        at org.geoserver.wms.GetMap.executeInternal(GetMap.java:344)
        at org.geoserver.wms.GetMap.run(GetMap.java:203)
        at org.geoserver.wms.GetMap.run(GetMap.java:113)
        at org.geoserver.wms.DefaultWebMapService.getMap(DefaultWebMapService.java:250)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)

A workaround to this issue is to disable the continuous map wrapping option in the WMS settings.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100196-sha1:dfd693a)

Atlassian logo