WMS GetMap memory issue

Hi list

I am having problems trying to display a Ordnance Survey MasterMap topgraphic area layer (source from MbTile) via a WMS request, whereby I hit a maximum memory error:
org.geoserver.platform.ServiceException: Rendering request would use 67713KB, whilst the maximum memory allowed is 65536KB

http://localhost/geoserver/os/wms?service=WMS&version=1.1.0&request=GetMap&layers=os:topographic_area&bbox=378800,393230,379350,393600&width=462&height=768&srs=EPSG:27700&styles=&format=application/openlayers

The layer uses a SLD stylesheet (supplied by the OS) and has many feature types defined. It is a very large polygon dataset, but will only display features below 1:4000. I have a similar layer for topographic lines which displays without issue.

I have searched the forum and other threads and the solution has been to increase the Max rendering memory (KB) size within the WMS settings in Geoserver from the default 65536KB. I have increased this to 512000KB plus I’ve increased the java web server (Jetty) buffer size to over 100000KB, but still get the error. Clearing the cache and restarting the server have not made any difference.

My GeoServer initialisation has:
JAVA_OPTS="-Xmx4096m -Xms1024m -XX:MaxPermSize=256m

The machine has plenty of memory and spare RAM. Could anyone please suggest other items to check as I’m out of ideas at the moment.

Thanks,
Jonny

Geoserver 2.26.2
Java version 11 64bit
Windows Server 2016
Memory 28672Mb

Teaching for that message - the code is checking the size configured before drawing. And that message only appears in the one location:

        if (maxMemory > 0 && memory > maxMemory) {
            long kbUsed = memory / KB;
            long kbMax = maxMemory / KB;
            throw new ServiceException(
                    "Rendering request would use "
                            + kbUsed
                            + "KB, whilst the "
                            + "maximum memory allowed is "
                            + kbMax
                            + "KB",
                    ServiceException.MAX_MEMORY_EXCEEDED);
        }

You say you have changed the Max Rendering Memory in the WMS Settings. Can you double check that please? There is a chance you have both the global WMS Settings and workspace WMS Settings to review…

Thank you for looking into this, it is much appreciated.

I wasn’t aware of the Workspace WMS Settings and had not seen it mentioned in the documentation or other threads regarding memory, once the Max Rendering Memory was increased from the default 65536KB value, the layer started displaying as expected. Thank you again for alerting me to this.

Cheers,
Jonny Heald

Hey Jonny

That’s wonderful to hear that you were helped so quickly. Would you consider helping others back, by making a quick fix to the documentation that you used and suggesting to others to check both the global WMS Settings and workspace WMS Settings.

Say it was on this page: WMS configuration — GeoServer 2.28.x User Manual, then look on the right hand menu for This Page >> Edit to get started.

Thanks!

Peter

Hi Peter.

I’m happy to help and will look to update the documentation in the next few days.

Thanks,
Jonny

1 Like