Saturday, 15 May 2010

java - Spring Data Rest gives GC overhead exceeded -



java - Spring Data Rest gives GC overhead exceeded -

edited

there 2 entities user , refsecquestion linked below -

inside user : changed eager work around bug

@manytoone(fetch = fetchtype.eager) @joincolumn(name = "question", nullable = false) public refsecquestion getrefsecquestion() { homecoming this.refsecquestion; }

inside refsecquestion :

@onetomany(fetch = fetchtype.lazy, mappedby = "refsecquestion") public set<user> getusers() { homecoming this.users; }

visiting url - /api/refsecquestions or /api/users/2/refsecquestions give error -

11:25:14,320 warn loadcontexts.cleanup():115 - hhh000100: fail-safe cleanup (collections) : org.hibernate.engine.loading.internal.collectionloadcontext@32f6b537<rs=org.apache.commons.dbcp2.delegatingresultset@72b935ef> 2014-10-19 11:25:14.522:warn:oejs.servlethandler:qtp1075697729-17: org.springframework.web.util.nestedservletexception: handler processing failed; nested exception java.lang.outofmemoryerror: gc overhead limit exceeded @ org.springframework.web.servlet.dispatcherservlet.triggeraftercompletionwitherror(dispatcherservlet.java:1280) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:958) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:870) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:961) @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:852) @ javax.servlet.http.httpservlet.service(httpservlet.java:687) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:837) @ javax.servlet.http.httpservlet.service(httpservlet.java:790) @ org.eclipse.jetty.servlet.servletholder.handle(servletholder.java:769) @ org.eclipse.jetty.servlet.servlethandler.dohandle(servlethandler.java:585) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:143) @ org.eclipse.jetty.security.securityhandler.handle(securityhandler.java:577) @ org.eclipse.jetty.server.session.sessionhandler.dohandle(sessionhandler.java:223) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1125) @ org.eclipse.jetty.servlet.servlethandler.doscope(servlethandler.java:515) @ org.eclipse.jetty.server.session.sessionhandler.doscope(sessionhandler.java:185) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1059) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141) @ org.eclipse.jetty.server.handler.contexthandlercollection.handle(contexthandlercollection.java:215) @ org.eclipse.jetty.server.handler.handlercollection.handle(handlercollection.java:110) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97) @ org.eclipse.jetty.server.server.handle(server.java:497) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:311) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:248) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:540) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:610) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:539) @ java.lang.thread.run(thread.java:745) caused by: java.lang.outofmemoryerror: gc overhead limit exceeded @ org.hibernate.internal.abstractsessionimpl.generateentitykey(abstractsessionimpl.java:327) @ org.hibernate.engine.internal.statefulpersistencecontext.getcollectionowner(statefulpersistencecontext.java:694) @ org.hibernate.loader.plan.exec.process.internal.collectionreferenceinitializerimpl.findcollectionowner(collectionreferenceinitializerimpl.java:141) @ org.hibernate.loader.plan.exec.process.internal.collectionreferenceinitializerimpl.finishuprow(collectionreferenceinitializerimpl.java:87) @ org.hibernate.loader.plan.exec.process.internal.abstractrowreader.readrow(abstractrowreader.java:125) @ org.hibernate.loader.plan.exec.process.internal.resultsetprocessorimpl.extractresults(resultsetprocessorimpl.java:129) @ org.hibernate.loader.plan.exec.internal.abstractloadplanbasedloader.executeload(abstractloadplanbasedloader.java:138) @ org.hibernate.loader.plan.exec.internal.abstractloadplanbasedloader.executeload(abstractloadplanbasedloader.java:102) @ org.hibernate.loader.collection.plan.abstractloadplanbasedcollectioninitializer.initialize(abstractloadplanbasedcollectioninitializer.java:100) @ org.hibernate.persister.collection.abstractcollectionpersister.initialize(abstractcollectionpersister.java:693) @ org.hibernate.event.internal.defaultinitializecollectioneventlistener.oninitializecollection(defaultinitializecollectioneventlistener.java:92) @ org.hibernate.internal.sessionimpl.initializecollection(sessionimpl.java:1897) @ org.hibernate.collection.internal.abstractpersistentcollection$4.dowork(abstractpersistentcollection.java:558) @ org.hibernate.collection.internal.abstractpersistentcollection.withtemporarysessionifneeded(abstractpersistentcollection.java:260) @ org.hibernate.collection.internal.abstractpersistentcollection.initialize(abstractpersistentcollection.java:554) @ org.hibernate.collection.internal.abstractpersistentcollection.read(abstractpersistentcollection.java:142) @ org.hibernate.collection.internal.abstractpersistentcollection$1.dowork(abstractpersistentcollection.java:171) @ org.hibernate.collection.internal.abstractpersistentcollection$1.dowork(abstractpersistentcollection.java:156) @ org.hibernate.collection.internal.abstractpersistentcollection.withtemporarysessionifneeded(abstractpersistentcollection.java:260) @ org.hibernate.collection.internal.abstractpersistentcollection.readsize(abstractpersistentcollection.java:155) @ org.hibernate.collection.internal.persistentset.isempty(persistentset.java:166) @ org.springframework.data.rest.webmvc.persistententityresourceassembler$1.dowithassociation(persistententityresourceassembler.java:159) @ org.springframework.data.mapping.model.basicpersistententity.dowithassociations(basicpersistententity.java:337) @ org.springframework.data.rest.webmvc.persistententityresourceassembler.getembeddedresources(persistententityresourceassembler.java:128) @ org.springframework.data.rest.webmvc.persistententityresourceassembler.wrap(persistententityresourceassembler.java:106) @ org.springframework.data.rest.webmvc.persistententityresourceassembler.toresource(persistententityresourceassembler.java:84) @ org.springframework.data.rest.webmvc.repositorypropertyreferencecontroller$1.apply(repositorypropertyreferencecontroller.java:141) @ org.springframework.data.rest.webmvc.repositorypropertyreferencecontroller$1.apply(repositorypropertyreferencecontroller.java:110) @ org.springframework.data.rest.webmvc.repositorypropertyreferencecontroller.dowithreferencedproperty(repositorypropertyreferencecontroller.java:464) @ org.springframework.data.rest.webmvc.repositorypropertyreferencecontroller.followpropertyreference(repositorypropertyreferencecontroller.java:148) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62)

gc overhead limit exceeded means run out of memory when using cms garbage collector. can either due memory leak or application having larger live dataset vm options allow. figure out issue use

-xx:+heapdumponoutofmemoryerror

and perchance -xx:heapdumppath (check java hotspot vm options more information). run tool eclipse mat figure out issue is. there several commercial tools available plumbr.

java spring hibernate spring-data spring-data-rest

No comments:

Post a Comment