Tobias S ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A108f1708-cf07-4c54-9714-4b9ab71ff5f7
 ) *created* an issue

GeoServer ( 
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiZjY5ZWNlNjIxYzhjNDQ4OGFiM2M5Nzc3Y2Q3NWZiYjkiLCJwIjoiaiJ9
 ) / Bug ( 
https://osgeo-org.atlassian.net/browse/GEOS-9667?atlOrigin=eyJpIjoiZjY5ZWNlNjIxYzhjNDQ4OGFiM2M5Nzc3Y2Q3NWZiYjkiLCJwIjoiaiJ9
 ) GEOS-9667 ( 
https://osgeo-org.atlassian.net/browse/GEOS-9667?atlOrigin=eyJpIjoiZjY5ZWNlNjIxYzhjNDQ4OGFiM2M5Nzc3Y2Q3NWZiYjkiLCJwIjoiaiJ9
 ) GDAL Store memory management ( 
https://osgeo-org.atlassian.net/browse/GEOS-9667?atlOrigin=eyJpIjoiZjY5ZWNlNjIxYzhjNDQ4OGFiM2M5Nzc3Y2Q3NWZiYjkiLCJwIjoiaiJ9
 )

Issue Type: Bug 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: Medium Reporter: Tobias S ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A108f1708-cf07-4c54-9714-4b9ab71ff5f7
 )

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 ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae9469ffc-5e16-4c2b-b7b0-b9c46e912f9e
 ) '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)?

( 
https://osgeo-org.atlassian.net/browse/GEOS-9667#add-comment?atlOrigin=eyJpIjoiZjY5ZWNlNjIxYzhjNDQ4OGFiM2M5Nzc3Y2Q3NWZiYjkiLCJwIjoiaiJ9
 ) Add Comment ( 
https://osgeo-org.atlassian.net/browse/GEOS-9667#add-comment?atlOrigin=eyJpIjoiZjY5ZWNlNjIxYzhjNDQ4OGFiM2M5Nzc3Y2Q3NWZiYjkiLCJwIjoiaiJ9
 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( 
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
 ) or iOS ( 
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100130- 
sha1:f95d0ca )
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to