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.
|