Application requirements:After geoserver releases the WMS map service, you need to request a large map image. The request address is as follows:
http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=campus&styles=&bbox=4.528514,4.950175,4.546676,4.958241&width=7430&height=3300&srs=EPSG:4326&format=image/png
The output map image ranges from 3300 to 7430 in height and width.
Question 1:After you press enter in the address bar of the browser to send the request, the following exception is thrown, prompting that the map rendering exceeds the size limit of KB:
<pre name="code" class="html"><?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"><ServiceExceptionReport version="1.1.1" > <ServiceException> Rendering request would use 71833KB, whilst the maximum memory allowed is 65536KB</ServiceException></ServiceExceptionReport>
Solution 1:Log on to the geoserver web admin page and click WMS in the left-side service.Max Rendering Memory (KB)The value is changed from 65536 to 6553600 to make sure it is sufficient. Request again.
Question 2:When the requested image size (height, width: 14860, 6600) is increased, an exception is still thrown. The request URL and exception information are as follows:
http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=campus&styles=&bbox=4.528514,4.950175,4.546676,4.958241&width=14860&height=6600&srs=EPSG:4326&format=image/png
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" > <ServiceException> java.lang.NegativeArraySizeExceptionnull</ServiceException></ServiceExceptionReport>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" > <ServiceException> java.lang.OutOfMemoryError: Java heap spaceJava heap space</ServiceException></ServiceExceptionReport>
Solution 2:Choose Start> Start geoserver, right-click Properties, and find "C: \ Program Files (x86) \ geoserver 2.5 \ bin \
Startup. bat", Open in Notepad:
call "C:\Program Files (x86)\Java\jdk1.8.0\bin\java.exe" -DGEOSERVER_DATA_DIR="C:\Program Files (x86)\GeoServer 2.5\data_dir" -Xmx512m -XX:MaxPermSize=128m -DSTOP.PORT=8079 -DSTOP.KEY=geoserver -Djetty.port=8080 -Djetty.logs="C:\Program Files (x86)\GeoServer 2.5\logs" -jar "C:\Program Files (x86)\GeoServer 2.5\start.jar"
Modify
-Xmx512m-XX: maxpermsize = 128 mPart, modify as follows:
call "C:\Program Files (x86)\Java\jdk1.8.0\bin\java.exe" -DGEOSERVER_DATA_DIR="C:\Program Files (x86)\GeoServer 2.5\data_dir" -Xmx1024m -XX:MaxPermSize=512m -DSTOP.PORT=8079 -DSTOP.KEY=geoserver -Djetty.port=8080 -Djetty.logs="C:\Program Files (x86)\GeoServer 2.5\logs" -jar "C:\Program Files (x86)\GeoServer 2.5\start.jar"
Request the map URL again to solve the problem.
References:
1. Maximum memory for getmap request
2. WMS Configuration
3. geoserver/Java out of heap space-how do I increase it?