[Geoserver-devel] [JIRA] (GEOS-9684) GWC TileLayer preview memory issue

Dana Lambert created an issue

GeoServer / BugGEOS-9684

GWC TileLayer preview memory issue

Issue Type:

BugBug

Affects Versions:

2.17.0, 2.17.1

Assignee:

Unassigned

Components:

GWC

Created:

09/Jul/20 5:45 AM

Environment:

Ubuntu 18.04

Priority:

MediumMedium

Reporter:

Dana Lambert

A very similar memory issue similar to https://osgeo-org.atlassian.net/browse/GEOS-9667 occurs when previewing a layer using geowebcache.

This issue occurs in the gwc package, where the metatile ImageReader is not being disposed and InputStream is not being closed when of type RenderedImageTimeDecorator.

To fix this, the following snippet can be added to GeoserverMetaTile here https://github.com/geoserver/geoserver/blob/master/src/gwc/src/main/java/org/geoserver/gwc/layer/GeoServerMetaTile.java#L240.

if (metaTileImage instanceof RenderedImageTimeDecorator)

{ metaTileImage = ((RenderedImageTimeDecorator) metaTileImage).getDelegate(); }

This checks if the metaTileImage is of type RenderedImageTimeDecorator. If it is, it sets metaTileImage to the delegate RenderedOp image. Two unit tests have been added to test firstly if the reader is disposed and secondly if the input stream is closed.

Another patch is also needed in geowebcache to add the reader dispose() call as part of the Metatile disposal method. This can be achieved by inserting the following snippet here https://github.com/GeoWebCache/geowebcache/blob/master/geowebcache/core/src/main/java/org/geowebcache/layer/MetaTile.java#L547

ImageReader reader = (ImageReader) param;
reader.dispose();

I have opened a PR against GeoWebCache to address this issue here https://github.com/GeoWebCache/geowebcache/pull/869.

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#100133-sha1:abe90d4)

Atlassian logo