过了一会儿并请求多个页面我收到以下错误。 我该如何解决这个问题?
May 26, 2011 1:02:16 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Api threw exception
java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.sun.net.ssl.internal.ssl.InputRecord.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.init(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1472)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1042)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:114)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2836)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2832)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
at de.giz.ff.domain.Subject.findSubject(Subject.java:139)
at de.giz.ff.domain.Question.getSubjectName(Question.java:354)
at de.giz.ff.server.Api.doFetch(Api.java:66)
at de.giz.ff.server.Api.doGet(Api.java:199)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:427)
May 26, 2011 1:02:27 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.util.ArrayList de.giz.ff.client.FrageFunktionService.getTextsAndRights(int,java.lang.String)' threw an unexpected exception: java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at waffle.servlet.NegotiateSecurityFilter.doFilterPrincipal(Unknown Source)
at waffle.servlet.NegotiateSecurityFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.HashMap.<init>(Unknown Source)
at org.hibernate.dialect.function.SQLFunctionRegistry.<init>(SQLFunctionRegistry.java:37)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:212)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)
at de.giz.ff.domain.Client.findClient(Client.java:49)
at de.giz.ff.server.FrageFunktionServiceImpl.getTextsAndRights(FrageFunktionServiceImpl.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
... 21 more
答案 0 :(得分:4)
我建议下载VisualVM 1.3.2,安装所有插件,并将其指向您的Tomcat应用,看看发生了什么。它会让你看到不同的内存生成,正在分配的对象,正在运行的线程等等。这是丰富的信息。
我在堆栈跟踪中看到了Hibernate和SQL Server。我认为Hibernate反射会迅速填满你的烫发空间。
答案 1 :(得分:1)
看起来您的应用程序使用了太多内存。您可以尝试增加Tomcat的内存分配量。如果您在Windows上将Tomcat作为服务安装,使用Tomcat监视器很容易实现,否则我认为您需要编辑config file。
我应该指出,如果你的应用程序有内存泄漏,无论你分配多少内存Tomcat,它最终都会崩溃。您还应该检查您的应用程序,以确保您不会在内存中创建大量无法销毁的对象。
答案 2 :(得分:0)
似乎您的垃圾收集器无法允许更多内存,尝试在setenv.sh中允许更多内存或者您可能有内存泄漏