Hi All

I've been toying around with the GDAL VRT data store (to wrap GeoTiffs
in this case) and I'm observing memory issues on Linux when requesting
WMS tiled responses. I've been investigating this myself, but I'll need
some help to solve this.

My JVM is limited to 3G (-Xmx) and GeoServer's memory use stays well
within this limit during normal use and rendering. However, my system's
memory use (RSS size) increases well beyond the JVM's limits when using
a gdal vrt store, even if I'm just wrapping an on-disk GeoTiff. It's
not quite driving my machine out of memory, but memory use is
significantly higher compared to GeoServer's built-in GeoTiff store.

I found that
`it.geosolutions.imageio.gdalframework.GDALImageReader.dispose()` calls
`GDALUtilities.closeDataSet`. This method calls `delete` on the actual
`org.gdal.gdal.Dataset`, which takes care of releasing the underlying
C++ pointers and memory. After adding extra logging to those methods,
it seems that `GDALImageReader.dispose` is only called when using
"standard" WMS requests, but is not called when using `tiled=true` in
the WMS request. I've also established that all WMS output images pass
through `org.geoserver.wms.RasterCleaner`, which correctly calls
`dispose` for single-image WMS requests (the image is a
`javax.media.jai.RenderedOp`). When using `tiled=true` however, the
RasterCleaner is unable able to access `GDALImageReader` and close the
dataset properly (the image is a `java.awt.image.BufferedImage`).

I'm unsure why tiled images take an entirely different path to response
than untiled images, and I'm also not sure how or where to call
`GDALImageReader.dispose()` within `org.geoserver.wms.GetMap` to ensure
it's called even for tiled WMS requests. At this point I'd appreciate
suggestions from anyone with a better understanding of the GeoServer
WMS architecture - not sure how to proceed from here.

Tobias







Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to