[Geoserver-users] Jave heap space exception on GetFeatureInfo request

Hello,

i get java heap space exceptions, when i try to get a WMS GetFeatureInfo request.

I’m using Geoserver 2.5 RC1 on tomcat 7 and Windows 2008R2, Java 1.7.0_45.

All data is stored in an oracle 11g database.

I’m using 6 datastores, with 70 layers each, each datastore has its own layergroup. All layers are styled with min and max scale denominators.

All 6 layergroups are then grouped together in one big layergroup, so i only have to tell openlayers to use this one layergroup to display my map.

Getting the feature infos is working fine when i’m not zoomed in.

When i zoom in to see more details and then start a GetFeatureInfo request, it works first. But after several request i will get java heap space exception (see below).

I already raised the heap space for tomcat to 12G, but it still gives me that error after several requests.

What can i do to prevent these errors?

Thanks for help in advance,

Dirk

2014-02-24 10:40:08,487 ERROR [geotools.rendering] - Java heap space

java.lang.OutOfMemoryError: Java heap space

at oracle.jdbc.driver.OracleStatement.prepareAccessors(OracleStatement.java:868)

at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1045)

at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)

at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316)

at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3361)

at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)

at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)

at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)

at org.geotools.jdbc.JDBCFeatureReader.(JDBCFeatureReader.java:157)

at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:594)

at org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:225)

at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:563)

at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:165)

at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:59)

at org.geotools.renderer.lite.StreamingRenderer.drawPlain(StreamingRenderer.java:2496)

at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:2066)

at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:837)

at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:483)

at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:251)

at org.geoserver.wms.featureinfo.VectorRenderingLayerIdentifier.identify(VectorRenderingLayerIdentifier.java:207)

at org.geoserver.wms.GetFeatureInfo.execute(GetFeatureInfo.java:77)

at org.geoserver.wms.GetFeatureInfo.run(GetFeatureInfo.java:43)

at org.geoserver.wms.DefaultWebMapService.getFeatureInfo(DefaultWebMapService.java:346)

at sun.reflect.GeneratedMethodAccessor861.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

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)

2014-02-24 10:40:08,565 ERROR [geoserver.ows] -

org.geoserver.platform.ServiceException: Rendering process failed

at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:509)

at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:251)

at org.geoserver.wms.featureinfo.VectorRenderingLayerIdentifier.identify(VectorRenderingLayerIdentifier.java:207)

at org.geoserver.wms.GetFeatureInfo.execute(GetFeatureInfo.java:77)

at org.geoserver.wms.GetFeatureInfo.run(GetFeatureInfo.java:43)

at org.geoserver.wms.DefaultWebMapService.getFeatureInfo(DefaultWebMapService.java:346)

at sun.reflect.GeneratedMethodAccessor861.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

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.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.$Proxy206.getFeatureInfo(Unknown Source)

at sun.reflect.GeneratedMethodAccessor852.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:774)

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:621)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.apache.catalina.filters.CorsFilter.handleSimpleCORS(CorsFilter.java:302)

at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:166)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:27)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:43)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:744)

Hello Wilhelm

Me too this problem occurs when I try to load rasters to build a pyramid using the JDBC plugin image mosaic.
Using Postgres + PostGIS 9.3.

It seems that the plugin selects the entire contents of rasters base of the pyramid 0 when you try to calculate the resolution mosaic base 0, when mounting the pyramid. For example, if your mosaic base is made of 0 and sum 50G tiffs, you’d have to have a java HEAP 50GB at least in the case of using JDBC with postgres …

Choose to use shapefiles, also if this is your case.

good luck
Miguel

···

Em 24-02-2014 07:02, Wilhelm, Dirk escreveu:

Hello,

i get java heap space exceptions, when i try to get a WMS GetFeatureInfo request.

I'm using Geoserver 2.5 RC1 on tomcat 7 and Windows 2008R2, Java  1.7.0_45.
All data is stored in an oracle 11g database.

I'm using 6 datastores, with 70 layers each, each datastore has its own layergroup. All layers are styled with min and max scale denominators.
All 6 layergroups are then grouped together in one big layergroup, so i only have to tell openlayers to use this one layergroup to display my map.

Getting the feature infos is working fine when i'm not zoomed in.

When i zoom in to see more details and then start a GetFeatureInfo request, it works first. But after several request i will get java heap space exception (see below).

I already raised the heap space for tomcat to 12G, but it still gives me that error after several requests.

What can i do to prevent these errors?

Thanks for help in advance,

  Dirk

2014-02-24 10:40:08,487 ERROR [geotools.rendering] - Java heap space
java.lang.OutOfMemoryError: Java heap space
                at oracle.jdbc.driver.OracleStatement.prepareAccessors(OracleStatement.java:868)
                at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1045)
                at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
                at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
                at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316)
                at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3361)
                at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
                at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
                at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
                at org.geotools.jdbc.JDBCFeatureReader.<init>(JDBCFeatureReader.java:157)
                at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:594)
                at org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:225)
                at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:563)
                at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:165)
                at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:59)
                at org.geotools.renderer.lite.StreamingRenderer.drawPlain(StreamingRenderer.java:2496)
                at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:2066)
                at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:837)
                at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:483)
                at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:251)
                at org.geoserver.wms.featureinfo.VectorRenderingLayerIdentifier.identify(VectorRenderingLayerIdentifier.java:207)
                at org.geoserver.wms.GetFeatureInfo.execute(GetFeatureInfo.java:77)
                at org.geoserver.wms.GetFeatureInfo.run(GetFeatureInfo.java:43)
                at org.geoserver.wms.DefaultWebMapService.getFeatureInfo(DefaultWebMapService.java:346)
                at sun.reflect.GeneratedMethodAccessor861.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:606)
                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)
2014-02-24 10:40:08,565 ERROR [geoserver.ows] -
org.geoserver.platform.ServiceException: Rendering process failed
                at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:509)
                at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:251)
                at org.geoserver.wms.featureinfo.VectorRenderingLayerIdentifier.identify(VectorRenderingLayerIdentifier.java:207)
                at org.geoserver.wms.GetFeatureInfo.execute(GetFeatureInfo.java:77)
                at org.geoserver.wms.GetFeatureInfo.run(GetFeatureInfo.java:43)
                at org.geoserver.wms.DefaultWebMapService.getFeatureInfo(DefaultWebMapService.java:346)
                at sun.reflect.GeneratedMethodAccessor861.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:606)
                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.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.$Proxy206.getFeatureInfo(Unknown Source)
                at sun.reflect.GeneratedMethodAccessor852.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:606)
                at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:774)
                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:621)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.apache.catalina.filters.CorsFilter.handleSimpleCORS(CorsFilter.java:302)
                at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:166)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:27)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:43)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
                at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
                at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                at java.lang.Thread.run(Thread.java:744)

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
[http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk)
_______________________________________________
Geoserver-users mailing list
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@anonymised.comsourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)

On Mon, Feb 24, 2014 at 11:02 AM, Wilhelm, Dirk <wilhelm@anonymised.com>wrote:

Hello,

i get java heap space exceptions, when i try to get a WMS GetFeatureInfo
request.

I'm using Geoserver 2.5 RC1 on tomcat 7 and Windows 2008R2, Java
1.7.0_45.

All data is stored in an oracle 11g database.

How are you connecting to Oracle? JNDI or plain store configuration where
you give host,
port and connection pool parameters?

It would be quite useful if you could make GeoServer go out of memory and
then issue a
command like:

jmap -histo:live <processid> | head -25

to see what's using the memory. JMap is available in all JDK distributions,
some more
info on how to use it here:
http://docs.geoserver.org/latest/en/user/production/troubleshooting.html#jmap

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On Mon, Feb 24, 2014 at 11:47 AM, Miguel Suarez Xavier Penteado <
miguel_penteado@anonymised.com> wrote:

Hello Wilhelm

Me too this problem occurs when I try to load rasters to build a pyramid using
the JDBC plugin image mosaic.
Using Postgres + PostGIS 9.3.

It seems that the plugin selects the entire contents of rasters base of
the pyramid 0 when you try to calculate the resolution mosaic base 0, when
mounting the pyramid. For example, if your mosaic base is made of 0 and
sum 50G tiffs, you'd have to have a java HEAP 50GB at least in the case of
using JDBC with postgres ...

Is this happening when using GetFeatureInfo only? The request
GetFeatureInfo makes against
a raster data set is pretty small, 5x5 pixels, maybe the JDBC mosaic plugin
is not good at extracting
only the part actually requested from the overall dataset. Or maybe level 0
has giant tiles?
Not sure, have little/no experience with the JDBC raster pyramid plugin.

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hello,

currently i’m connection to oracle using the plain store configuration inside geoserver. I will try jndi next.

Here is the jmap output after i received a java heap exception:

jmap -heap 4872

Attaching to process ID 4872, please wait…

Debugger attached successfully.

Server compiler detected.

JVM version is 24.45-b08

using thread-local object allocation.

Parallel GC with 8 thread(s)

Heap Configuration:

MinHeapFreeRatio = 40

MaxHeapFreeRatio = 70

MaxHeapSize = 10485760000 (10000.0MB)

NewSize = 1310720 (1.25MB)

MaxNewSize = 17592186044415 MB

OldSize = 5439488 (5.1875MB)

NewRatio = 2

SurvivorRatio = 8

PermSize = 21757952 (20.75MB)

MaxPermSize = 1073741824 (1024.0MB)

G1HeapRegionSize = 0 (0.0MB)

Heap Usage:

PS Young Generation

Eden Space:

capacity = 1165492224 (1111.5MB)

used = 1162228528 (1108.3874969482422MB)

free = 3263696 (3.1125030517578125MB)

99.71997273488459% used

From Space:

capacity = 1164967936 (1111.0MB)

used = 0 (0.0MB)

free = 1164967936 (1111.0MB)

0.0% used

To Space:

capacity = 1164967936 (1111.0MB)

used = 0 (0.0MB)

free = 1164967936 (1111.0MB)

0.0% used

PS Old Generation

capacity = 6990331904 (6666.5MB)

used = 6983625848 (6660.104606628418MB)

free = 6706056 (6.395393371582031MB)

99.9040667010938% used

PS Perm Generation

capacity = 134217728 (128.0MB)

used = 134217496 (127.9997787475586MB)

free = 232 (2.2125244140625E-4MB)

99.99982714653015% used

35196 interned Strings occupying 3705584 bytes.

jmap -histo:live 4872 | more

num #instances #bytes class name

···

Von: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] Im Auftrag von Andrea Aime
Gesendet: Montag, 24. Februar 2014 12:16
An: Wilhelm, Dirk
Cc: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Jave heap space exception on GetFeatureInfo request

How are you connecting to Oracle? JNDI or plain store configuration where you give host,

port and connection pool parameters?

It would be quite useful if you could make GeoServer go out of memory and then issue a

command like:

jmap -histo:live | head -25

to see what’s using the memory. JMap is available in all JDK distributions, some more

info on how to use it here:

http://docs.geoserver.org/latest/en/user/production/troubleshooting.html#jmap

Cheers

Andrea

== Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information ==

Ing. Andrea Aime

@geowolf

Technical Lead

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it

http://twitter.com/geosolutions_it


On Mon, Feb 24, 2014 at 2:25 PM, Wilhelm, Dirk <wilhelm@anonymised.com>wrote:

Hello,

currently i'm connection to oracle using the plain store configuration
inside geoserver. I will try jndi next.

Ah no, that won't help. This issue just got fixed, if you use a released
version using JNDI will just make things worse:
http://jira.codehaus.org/browse/GEOS-5276

Here is the jmap output after i received a java heap exception:

>jmap -heap 4872

Attaching to process ID 4872, please wait...

Debugger attached successfully.

Server compiler detected.

JVM version is 24.45-b08

using thread-local object allocation.

Parallel GC with 8 thread(s)

Heap Configuration:

   MinHeapFreeRatio = 40

   MaxHeapFreeRatio = 70

   MaxHeapSize = 10485760000 (10000.0MB)

   NewSize = 1310720 (1.25MB)

   MaxNewSize = 17592186044415 MB

   OldSize = 5439488 (5.1875MB)

   NewRatio = 2

   SurvivorRatio = 8

   PermSize = 21757952 (20.75MB)

   MaxPermSize = 1073741824 (1024.0MB)

   G1HeapRegionSize = 0 (0.0MB)

Heap Usage:

PS Young Generation

Eden Space:

   capacity = 1165492224 (1111.5MB)

   used = 1162228528 (1108.3874969482422MB)

   free = 3263696 (3.1125030517578125MB)

   99.71997273488459% used

From Space:

   capacity = 1164967936 (1111.0MB)

   used = 0 (0.0MB)

   free = 1164967936 (1111.0MB)

   0.0% used

To Space:

   capacity = 1164967936 (1111.0MB)

   used = 0 (0.0MB)

   free = 1164967936 (1111.0MB)

   0.0% used

PS Old Generation

   capacity = 6990331904 (6666.5MB)

   used = 6983625848 (6660.104606628418MB)

   free = 6706056 (6.395393371582031MB)

   99.9040667010938% used

PS Perm Generation

   capacity = 134217728 (128.0MB)

   used = 134217496 (127.9997787475586MB)

   free = 232 (2.2125244140625E-4MB)

   99.99982714653015% used

35196 interned Strings occupying 3705584 bytes.

>jmap -histo:live 4872 | more

num #instances #bytes class name

----------------------------------------------

   1: 383807 7927174496 [C

Hmm... it seems this is the problem, lots of char arrays, and large ones
too (20kb each
on average)... but I have no idea why you'd get these.
Do you have TEXT/CLOB attributes in your features?

Yet, I don't see retained SimpleFeature objects in your jmap output...

If you have time, also try starting the Java virtual machine running
GeoServer with
this option:
-Dorg.geoserver.wms.featureinfo.render.enabled=false

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi,

disabling the featureinfo render option didn’t help.

My features don’t have clobs, but most of them have 5 to 15 varchar2 with sizes between 256bytes and 2000bytes.

Regards,

Dirk

···

Von: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] Im Auftrag von Andrea Aime
Gesendet: Montag, 24. Februar 2014 14:32
An: Wilhelm, Dirk
Cc: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Jave heap space exception on GetFeatureInfo request

Hmm… it seems this is the problem, lots of char arrays, and large ones too (20kb each

on average)… but I have no idea why you’d get these.

Do you have TEXT/CLOB attributes in your features?

Yet, I don’t see retained SimpleFeature objects in your jmap output…

If you have time, also try starting the Java virtual machine running GeoServer with

this option:

-Dorg.geoserver.wms.featureinfo.render.enabled=false

Cheers

Andrea

== Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information ==

Ing. Andrea Aime

@geowolf

Technical Lead

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it

http://twitter.com/geosolutions_it


On Mon, Feb 24, 2014 at 2:53 PM, Wilhelm, Dirk <wilhelm@anonymised.com>wrote:

Hi,

disabling the featureinfo render option didn't help.

Just to be sure, what is the value of "fetch size" in your database
configuration?
Also, is there any other application deployed along GeoServer?

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Fetch size is 1000.

GeoServer is the only application in my tomcat instance.

Regards,

Dirk

···

Von: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] Im Auftrag von Andrea Aime
Gesendet: Montag, 24. Februar 2014 14:55
An: Wilhelm, Dirk
Cc: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Jave heap space exception on GetFeatureInfo request

Just to be sure, what is the value of “fetch size” in your database configuration?

Also, is there any other application deployed along GeoServer?

Cheers

Andrea

== Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information ==

Ing. Andrea Aime

@geowolf

Technical Lead

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it

http://twitter.com/geosolutions_it


On Mon, Feb 24, 2014 at 3:00 PM, Wilhelm, Dirk <wilhelm@anonymised.com>wrote:

Fetch size is 1000.

GeoServer is the only application in my tomcat instance.

I've just completed a test run against my local GeoServer, 20000
GetFeatureInfo requests,
with 8 concurrent clients, against a layer group stored in PostGIS, around
12 layers,
overall dataset size around 20GB... and no OOM, nor slowdowns during the
operation
(130 GetFeatureInfo per second on average, on a 3 years old desktop
machine).

So it seems it's somewhat specific to your environment, but I have no clue
what
the issue might be.

If you could grab and share a memory dump, that might provide some info.

jmap -dump:live,file=/tmp/dump.hprof <processId>

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hello,

i just uploaded a zip file with a dump to my dropbox:

https://dl.dropboxusercontent.com/u/22117905/dump.zip

Regards,

Dirk

···

Von: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] Im Auftrag von Andrea Aime
Gesendet: Montag, 24. Februar 2014 15:10
An: Wilhelm, Dirk
Cc: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Jave heap space exception on GetFeatureInfo request

If you could grab and share a memory dump, that might provide some info.

jmap -dump:live,file=/tmp/dump.hprof

Cheers

Andrea

On Mon, Feb 24, 2014 at 3:39 PM, Wilhelm, Dirk <wilhelm@anonymised.com>wrote:

Hello,

i just uploaded a zip file with a dump to my dropbox:

https://dl.dropboxusercontent.com/u/22117905/dump.zip

Thank you, that was most useful. Here is what's holding all that memory
(brace yourself):

!image.png|831x491

So... it seems that the Oracle driver keeps a large char buffer for each
prepared statement, so that it can read
one row from your database in a single shot, and in your case, that gets
very large, very quickly.
Some discussion about the issue here:
http://stackoverflow.com/questions/2876895/oracle-t4cpreparedstatement-memory-leaks

Now... it could also be that we are leaking statements, but a value of 362
prepared statement objects does not seem strange,
in the end by default we allow 10 connections max, with each 50 cached
prepared statements, which would mean 500 of them,
you're below that threshold.
Doing a quick math is seems each prepared statement holds a buffer 23MB
large, which is really huge...

I guess you can have a a look at that Oracle PDF linked from stackoverflow,
and see if there is anything that can be done to mitigate
the issue, and in the meantime, I'd suggest to lower the number of cached
prepared statements in the data store configuration

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On Tue, Feb 25, 2014 at 10:18 AM, Andrea Aime
<andrea.aime@anonymised.com>wrote:

On Mon, Feb 24, 2014 at 3:39 PM, Wilhelm, Dirk <wilhelm@anonymised.com>wrote:

Hello,

i just uploaded a zip file with a dump to my dropbox:

https://dl.dropboxusercontent.com/u/22117905/dump.zip

Thank you, that was most useful. Here is what's holding all that memory
(brace yourself):

!image.png|831x491

So... it seems that the Oracle driver keeps a large char buffer for each
prepared statement, so that it can read
one row from your database in a single shot, and in your case, that gets
very large, very quickly.
Some discussion about the issue here:

http://stackoverflow.com/questions/2876895/oracle-t4cpreparedstatement-memory-leaks

Now... it could also be that we are leaking statements, but a value of 362
prepared statement objects does not seem strange,
in the end by default we allow 10 connections max, with each 50 cached
prepared statements, which would mean 500 of them,
you're below that threshold.

By the way, sowewhat weird that we have 362 T4CPreparedStatements recorded
in the main table, but then 701 in the "merged paths"
sub-table but... oh well, it still depends which configuration the
datastore has.
Dirk, can you share your connection pool parameters?

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi,

all 6 data stores are configured like this:

max connections 100

min connetions 1

fetch size 1000

Connection timeout 20

Max open prepared statements 50

validate connections, loose bbox and estimated extends are checked

Regards,

Dirk

On Tue, Feb 25, 2014 at 11:17 AM, Wilhelm, Dirk <wilhelm@anonymised.com>wrote:

Hi,

all 6 data stores are configured like this:

max connections 100

min connetions 1

fetch size 1000

Connection timeout 20

Max open prepared statements 50

validate connections, loose bbox and estimated extends are checked

Right, in this case the prepared statement leak does not seem likely, but
you'll have to do
something to limit your memory usage (see the PDF).
Given the numbers we have, you'd need 100 (conn) * 50 (statement) * 20MB
(buffer for each statement) -> 100GB
or memory just to keep the prepared statement buffers

Limiting the fetch size and the number of cached prepared statement is a
quick way to start,
but glancing over the PDF, it seems you'll also have to work on the
definition of your table.

Alternatively, we could look into implementing a non prepared statement
version of
the Oracle dialect, which would solve the issue at the root, but that would
surely require
some days of work

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

I’m starting now by reducing the fetchsize and connections and see how that turns out.

Thanks for the help.

Regards,

Dirk

···

Von: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] Im Auftrag von Andrea Aime
Gesendet: Dienstag, 25. Februar 2014 11:29
An: Wilhelm, Dirk
Cc: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Jave heap space exception on GetFeatureInfo request

On Tue, Feb 25, 2014 at 11:17 AM, Wilhelm, Dirk <wilhelm@anonymised.com> wrote:

Hi,

all 6 data stores are configured like this:

max connections 100

min connetions 1

fetch size 1000

Connection timeout 20

Max open prepared statements 50

validate connections, loose bbox and estimated extends are checked

Right, in this case the prepared statement leak does not seem likely, but you’ll have to do

something to limit your memory usage (see the PDF).

Given the numbers we have, you’d need 100 (conn) * 50 (statement) * 20MB (buffer for each statement) → 100GB

or memory just to keep the prepared statement buffers

Limiting the fetch size and the number of cached prepared statement is a quick way to start,

but glancing over the PDF, it seems you’ll also have to work on the definition of your table.

Alternatively, we could look into implementing a non prepared statement version of

the Oracle dialect, which would solve the issue at the root, but that would surely require

some days of work

Cheers

Andrea

== Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information ==

Ing. Andrea Aime

@geowolf

Technical Lead

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it

http://twitter.com/geosolutions_it