[Geoserver-devel] [JIRA] (GEOS-9667) GDAL Store memory management

Tobias S created an issue

GeoServer / BugGEOS-9667

GDAL Store memory management

Issue Type:

BugBug

Affects Versions:

2.17.0, 2.17.1

Assignee:

Unassigned

Components:

WMS

Created:

29/Jun/20 9:51 AM

Environment:

Debian Buster
Tomcat 9.0.36
GDAL 3

Priority:

MediumMedium

Reporter:

Tobias S

I’ve recently reported issues with memory management when rendering tiled responses from a GDAL VRT store to the mailing list: https://sourceforge.net/p/geoserver/mailman/message/37047537/

In short, I observe growing memory use outside of the JVM when requesting tiled WMS responses from GDAL VRT stores. I have observed that the GDAL dataset’s delete method is not called for tiled responses, although this method takes care of releasing associated memory.

As per Andrea Aime’s suggestion I’ve investigated the MetatileMapOutputFormat today.

I found that the individual tiles are correctly passed to the RasterCleaner (ie https://github.com/geoserver/geoserver/blob/b68cc42ebb5bb2151bc14af4704e50c0554a3c87/src/wms/src/main/java/org/geoserver/wms/map/MetatileMapOutputFormat.java#L322).

However, the metatile image (which indirectly holds a reference to GDALImageReader) is never actually passed to RasterCleaner: https://github.com/geoserver/geoserver/blob/b68cc42ebb5bb2151bc14af4704e50c0554a3c87/src/wms/src/main/java/org/geoserver/wms/map/MetatileMapOutputFormat.java#L171-L177

My plan from here would be to create a PR including:

  1. A modified MetatileMapOutputFormat to pass the metatile image to RasterCleaner.
  2. A test case to ensure that MetatileMapOutputFormat correctly calls the reader’s dispose() method.

My main questions are:

  • Is this actually a bug, or is the current implementation the desired behaviour?
  • Is this likely to be GDAL specific (ie do we need a test environment with GDAL bindings) or is this an issue for other store types (ie can I write the test to use any default GridCoverageReader’s dispose method)?

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#100130-sha1:f95d0ca)

Atlassian logo