0

I have some memory problems with my Geoserver.

I am currently running Geoserver 2.5.2 (installed from Windows Service Installer) on a Windows Server 2008 R2.

When I launch the service (Start Geoserver) I see Java consumes about 174MB of memory. When I request WMSLayers, I see the memory increases each time with each request to reach 1,109GB but it never decreases. So after a while it stops working.

WMSLayers are used to render a PNG file (width 6520, height 4078, bit depth 32, size 1.2KB) stored in the same server as the Geoserver is installed.

In the wrapper.conf files, the maximum java heap was 512 MB so i have changed it to 1024 MB yet i still get the problem.

Error in the geoserver log: 
*2015-12-03 09:32:34,869 DEBUG [org.geotools.rendering] - Java heap space
java.lang.OutOfMemoryError: Java heap space
2015-12-03 09:32:34,869 DEBUG [org.geotools.rendering] - Unable to renderer this raster, no workaround found
2015-12-03 09:32:34,870 DEBUG [org.geotools.rendering] - Raster rendered
2015-12-03 09:32:34,870 DEBUG [org.geotools.rendering] - Rendering Raster CoverageDimensionCustomizerReader.GridCoverageWrapper["mosaic-1440", GeneralEnvelope[(-127.327144225, 21.27408544), (-49.75003262499999, 57.99455878)], DefaultGeographicCRS["WGS 84"]]
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
? Image=RenderedOp["ImageRead"]

2015-12-03 09:32:34,870 DEBUG [org.geotools.rendering] - Drawing coverage CoverageDimensionCustomizerReader.GridCoverageWrapper["mosaic-1440", GeneralEnvelope[(-127.327144225, 21.27408544), (-49.75003262499999, 57.99455878)], DefaultGeographicCRS["WGS 84"]]
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
? Image=RenderedOp["ImageRead"]

2015-12-03 09:32:34,870 DEBUG [org.geotools.rendering] - Drawing coverage CoverageDimensionCustomizerReader.GridCoverageWrapper["mosaic-1440", GeneralEnvelope[(-127.327144225, 21.27408544), (-49.75003262499999, 57.99455878)], DefaultGeographicCRS["WGS 84"]]
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
?   CoverageDimensionCustomizerReader.WrappedSampleDimension([])
? Image=RenderedOp["ImageRead"]

2015-12-03 09:32:34,871 DEBUG [org.geotools.rendering] - Transforming coverage envelope with transform INVERSE_MT[PARAM_MT["Popular Visualisation Pseudo Mercator", 
    PARAMETER["semi_major", 6378137.0], 
    PARAMETER["semi_minor", 6378137.0], 
    PARAMETER["latitude_of_origin", 0.0], 
    PARAMETER["central_meridian", 0.0], 
    PARAMETER["scale_factor", 1.0], 
    PARAMETER["false_easting", 0.0], 
    PARAMETER["false_northing", 0.0]]]
2015-12-03 09:32:34,871 DEBUG [org.geotools.rendering] - Using interpolation javax.media.jai.InterpolationNearest@67a7e2
2015-12-03 09:32:34,872 DEBUG [org.geotools.referencing.operation.transform] - Optimizing the warp into an affine transformation: AffineTransform[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
2015-12-03 09:32:34,876 TRACE [org.geotools.resources] - Loaded resources for English from bundle "org.geotools.resources.i18n".
2015-12-03 09:32:34,876 DEBUG [org.geotools.coverage.processing] - Resampled coverage "mosaic-1440" from coordinate system "WGS 84" (for an image of size 56×27) to coordinate system "WGS 84 / Pseudo-Mercator" (image size 56×27). JAI operation is "Warp" with "Nearest" interpolation on geophysics pixels values. Background value is (0, 0, 0, 0).
2015-12-03 09:32:34,876 DEBUG [org.geotools.rendering] - Reprojecting to crs PROJCS["WGS 84 / Pseudo-Mercator", 
  GEOGCS["WGS 84", 
    DATUM["World Geodetic System 1984", 
      SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
      AUTHORITY["EPSG","6326"]], 
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic longitude", EAST], 
    AXIS["Geodetic latitude", NORTH], 
    AUTHORITY["EPSG","4326"]], 
  PROJECTION["Popular Visualisation Pseudo Mercator", AUTHORITY["EPSG","1024"]], 
  PARAMETER["semi_minor", 6378137.0], 
  PARAMETER["latitude_of_origin", 0.0], 
  PARAMETER["central_meridian", 0.0], 
  PARAMETER["scale_factor", 1.0], 
  PARAMETER["false_easting", 0.0], 
  PARAMETER["false_northing", 0.0], 
  UNIT["m", 1.0], 
  AXIS["Easting", EAST], 
  AXIS["Northing", NORTH], 
  AUTHORITY["EPSG","3857"]]
2015-12-03 09:32:34,876 DEBUG [org.geotools.rendering] - Raster Symbolizer 
2015-12-03 09:32:34,896 DEBUG [org.geotools.rendering] - Raster Symbolizer 
2015-12-03 09:32:34,897 TRACE [org.geotools.resources] - Loaded resources for <default> from bundle "org.geotools.renderer.i18n".
2015-12-03 09:33:01,688 DEBUG [org.geotools.rendering] - Java heap space
java.lang.OutOfMemoryError: Java heap space
2015-12-03 09:33:01,689 DEBUG [org.geotools.rendering] - Unable to renderer this raster, no workaround found
2015-12-03 09:33:01,689 DEBUG [org.geotools.rendering] - Raster rendered
2015-12-03 09:33:01,689 DEBUG [org.geotools.rendering] - Style cache hit ratio: NaN , hits 0, requests 0
2015-12-03 09:33:01,689 ERROR [org.geoserver.ows] - 
org.geoserver.platform.ServiceException: This requested used more time than allowed and has been forcefully stopped. Max rendering time is 60.0s
    at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:501)
    at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:251)
    at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:123)
    at org.geoserver.wms.GetMap.executeInternal(GetMap.java:509)
    at org.geoserver.wms.GetMap.run(GetMap.java:253)
    at org.geoserver.wms.GetMap.run(GetMap.java:124)
    at org.geoserver.wms.DefaultWebMapService.getMap(DefaultWebMapService.java:328)
    at sun.reflect.GeneratedMethodAccessor266.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.geoserver.kml.WebMapServiceKmlInterceptor.invoke(WebMapServiceKmlInterceptor.java:34)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:61)
    at org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:35)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:73)
    at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:54)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:54)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at com.sun.proxy.$Proxy62.getMap(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:790)
    at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:272)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
    at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:27)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74)
    at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:70)
    at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
    at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:82)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
    at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
    at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:134)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)*

NB: If i did the same request when i restart Geoserver, it will only take 2 seconds.

  • That is a timeout message not an error. Please add the log file (debug level) of the actual request being made, a note of what the layer you are trying to render is and where it is stored. – Ian Turton Dec 3 '15 at 13:48
  • Sorry @iant but how to get the debug level? Im using wms layers to render a shape file in the same server as the geoserver – mhd Dec 3 '15 at 13:54
  • Go to Global settings - Logging profile. Geotools developer profile is probably best for your case. I suppose you have big shapefiles and you are requesting a large area -> lots of vectors to handle for rendering the image. – user30184 Dec 3 '15 at 14:10
  • goto the global settings and change the logging level there – Ian Turton Dec 3 '15 at 14:20
  • 1
    Png is the worst file format of all for servers because it must be decompressed totally before server can do anything for it. Convert it into tiled tiff using LZW, deflate, or jpeg compression depending on the nature of the png. Jpeg for aerial images, LZW or deflate for maps. Create also overview layers. You will find instructions from the web. – user30184 Dec 3 '15 at 15:12
3

Java Heap space isn't the only important parameter you have to set when working with rasters. I had to deal with caching of many layers inside my Geoserver and it was still crashing until I set these parameters to my "bin/startup.bat" file (Xms, Xmx, MaxPermSize):

:run if "%JAVA_OPTS%" == "" (set JAVA_OPTS="-Xms2048m -Xmx6144m -XX:MaxPermSize=512m")

Take a look here (Advanced Production GeoServer configuration) for more informations. I believe this can help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.