Hi,
I'm not sure what's going on there... you might want to check the class
responsible for on-the-fly
meta tiling here (assuming it's not going into the "direct GWC integration"
path, that would be a completely different beast):
https://github.com/geoserver/geoserver/blob/master/src/wms/src/main/java/org/geoserver/wms/map/MetatileMapOutputFormat.java#L171

The class builds a 3x3 meta-tile, splits it into the 9 components that get
cached. The original image is however
set into the returned RenderedImageMap, which should be then managed by the
RasterCleaner
<https://github.com/geoserver/geoserver/blob/master/src/wms/src/main/java/org/geoserver/wms/RasterCleaner.java>
for resource disposal.

Not sure why it's not happening in the case of using GDAL, but hope the
above gives you enough hints
to continue your investigation.

If you find out what's going on, please:

   - Open a ticket with some insight
   <https://osgeo-org.atlassian.net/projects/GEOS/summary>
   - Create a pull request to fix it
   <https://github.com/geoserver/geoserver/blob/master/CONTRIBUTING.md>, or
   at least attach a reproducible test case to the ticket above

Cheers
Andrea

On Sat, Jun 27, 2020 at 8:39 AM Tobias Schulmann <[email protected]>
wrote:

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


-- 

Regards, Andrea Aime

== GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf
Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa
(LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549
http://www.geo-solutions.it http://twitter.com/geosolutions_it
------------------------------------------------------- *Con riferimento
alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 -
Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto, gli eventuali
allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i
destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per
errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le
sarei comunque grato se potesse darmene notizia. This email is intended
only for the person or entity to which it is addressed and may contain
information that is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European Regulation 2016/679
“GDPR” - copying, dissemination or use of this e-mail or the information
herein by anyone other than the intended recipient is prohibited. If you
have received this email by mistake, please notify us immediately by
telephone or e-mail.*
_______________________________________________
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