← Back to team overview

dhis2-devs team mailing list archive

OutOfMemory problem with Android SDK and 2.22-legacy branch

 

Hello everyone,

while using the SDK in its 2.22-legacy branch in our app, when we pull data
and metadata from a 2.22 DHIS2 server, we're getting an OutOfMemory
exception, that seems to come from the following api call
https://hnqis-staging.psi-mis.org/api/programs/wK0958s1bdj?fields=*%2CtrackedEntity%5B*%5D%2CprogramIndicators%5B*%5D%2CprogramStages%5B*%2C%21dataEntryForm%2Cprogram%5Bid%5D%2CprogramIndicators%5B*%5D%2CprogramStageSections%5B*%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2Cid%2CattributeValues%5B*%2Cattribute%5B*%5D%5D%2CoptionSet%5Bid%5D%5D%5D%2CprogramIndicators%5B*%5D%5D%2CprogramStageDataElements%5B*%2CprogramStage%5Bid%5D%2CdataElement%5B*%2CoptionSet%5Bid%5D%5D%5D%5D%2CprogramTrackedEntityAttributes%5B*%2CtrackedEntityAttribute%5B*%5D%5D%2C%21organisationUnits%29

I attach the complete Tomcat response.

Do you have any idea about why are we getting this problem in a 2.22 server
while in an equivalent 2.20 server everything's working fine (with the same
amount of memory available for Tomcat)? Is this an api bug?

Thank you in advance


-- 
----
Clave pública PGP:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8185416E
HTTP Status 500 - Handler processing failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded

type Exception report

message Handler processing failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded
	org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1302)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:977)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:856)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:841)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter.java:88)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.hisp.dhis.security.filter.CustomAuthenticationFilter.doFilter(CustomAuthenticationFilter.java:64)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:140)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter(AutomaticAccessFilter.java:115)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
	org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
	org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)
	org.hisp.dhis.servlet.filter.ExcludableShallowEtagHeaderFilter.doFilterInternal(ExcludableShallowEtagHeaderFilter.java:102)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

java.lang.OutOfMemoryError: GC overhead limit exceeded
	java.util.HashMap$KeySet.iterator(HashMap.java:912)
	java.util.HashSet.iterator(HashSet.java:172)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.updateFields(DefaultFieldFilterService.java:338)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.updateFields(DefaultFieldFilterService.java:330)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:185)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:170)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:245)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:170)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:304)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:294)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:170)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:304)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:294)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:294)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:294)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.buildNode(DefaultFieldFilterService.java:170)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.lambda$filter$16(DefaultFieldFilterService.java:162)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService$$Lambda$40/942329685.accept(Unknown Source)
	java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
	java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	org.hisp.dhis.fieldfilter.DefaultFieldFilterService.filter(DefaultFieldFilterService.java:162)
	org.hisp.dhis.webapi.controller.AbstractCrudController.getObjectInternal(AbstractCrudController.java:439)
	org.hisp.dhis.webapi.controller.AbstractCrudController.getObject(AbstractCrudController.java:231)
	sun.reflect.GeneratedMethodAccessor522.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:775)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.54 logs.

Apache Tomcat/7.0.54

Follow ups