tomcat 報錯 java.lang.OutOfMemoryErro
tomcat 報錯 java.lang.OutOfMemoryError ( PermGen space)異常的解決方法
我使用SpringSource Tool Suite 3.0.1,Tomcat 7,我成功的編譯了我的web程式,tomcat可以正常執行,但是當重啟tomcat server時會出現下面的異常資訊:
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: PermGen space
詳細的異常資訊如下:
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: PermGen space org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:839) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.(BasicAuthenticationFilter.java:177) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) root cause java.lang.OutOfMemoryError: PermGen space java.lang.ClassLoader.defineClass1(Native Method) java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) java.lang.ClassLoader.defineClass(ClassLoader.java:615) java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) java.net.URLClassLoader.defineClass(URLClassLoader.java:283) java.net.URLClassLoader.access$000(URLClassLoader.java:58) java.net.URLClassLoader$1.run(URLClassLoader.java:197) java.security.AccessController.doPrivileged(Native Method) java.net.URLClassLoader.findClass(URLClassLoader.java:190) java.lang.ClassLoader.loadClass(ClassLoader.java:306) java.lang.ClassLoader.loadClass(ClassLoader.java:247) org.eclipse.jdt.internal.compiler.parser.Parser.createJavadocParser(Parser.java:8256) org.eclipse.jdt.internal.compiler.parser.Parser.(Parser.java:889) org.eclipse.jdt.internal.compiler.Compiler.initializeParser(Compiler.java:685) org.eclipse.jdt.internal.compiler.Compiler.(Compiler.java:283) org.eclipse.jdt.internal.compiler.Compiler.(Compiler.java:204) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:442) org.apache.jasper.compiler.Compiler.compile(Compiler.java:378) org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:644) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
在tomcat的日誌中可以看到具體的異常資訊
org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.views.login_jsp org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:178) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.(BasicAuthenticationFilter.java:177) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) root cause java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.views.login_jsp java.net.URLClassLoader$1.run(URLClassLoader.java:202) java.security.AccessController.doPrivileged(Native Method) java.net.URLClassLoader.findClass(URLClassLoader.java:190) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.(BasicAuthenticationFilter.java:177) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.21 logs.
這個問題是典型的記憶體溢位異常,”java.lang.OutOfMemoryError: PermGen space“表示記憶體永久區溢位了。
要解決這個問題需要配置jvm引數,增加永久區的記憶體大小,如下配置引數:
-Xmx1024m -XX:MaxPermSize=512m
原文連結:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/1868/viewspace-2811191/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- tomcat釋出報錯Tomcat
- 關閉tomcat報錯Cannot allocate memoryTomcat
- solr搜尋報錯,tomcat maxHttpHeaderSize 設定SolrTomcatHTTPHeader
- tomcat伺服器經常報錯PermGen SpaceTomcat伺服器
- springcloud和Eureka整合時報錯:Unable to start embedded TomcatSpringGCCloudTomcat
- tomcat-啟動報錯Multiple Contexts have a path of "/xxxx"TomcatContext
- Tomcat啟動報錯:Error starting static Resources解決方法TomcatError
- tomcat新增專案報錯:There are no resources that can be added or removed from the serverTomcatREMServer
- tomcat啟動報錯java.util.zip.ZipException:invalidCENheader(badsignature)TomcatJavaExceptionHeader
- maven外掛 tomcat7啟動報錯,異常如下MavenTomcat
- Tomcat啟動時Initializing Spring FrameworkServlet 'springmvc'卡住,並且不報錯TomcatFrameworkServletSpringMVC
- tomcat報錯org.apache.catalina.core.ContainerBase.startInternal A child container failed during startTomcatApacheAI
- Oracle利用errorstack追蹤tomcat報錯ORA-00903 無效表名OracleErrorTomcat
- Eclipse裡Tomcat報錯:Document base ……does not exist or is not a readable directory(圖文詳解)...EclipseTomcat
- Tomcat啟動後頁面可以正常訪問 介面路徑報錯404Tomcat
- myeclipse執行tomcat報錯Exception in thread "main" java.lang.OutOfMemoryError: PermGen space...EclipseTomcatExceptionthreadAIJavaError
- 如何斷點除錯Tomcat原始碼斷點除錯Tomcat原始碼
- 解決啟動Tomcat報錯:Failed to destroy end point associated with ProtocolHandler["ajp-nio-8009"]TomcatAIProtocol
- 部署Maven專案到tomcat報錯:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi...MavenTomcatJavaExceptionSpringFrameworkWebContext
- 解決Tomcat啟動報錯問題:Failed to destroy end point associated with ProtocolHandler["ajp-nio-8009"]TomcatAIProtocol
- JavaScript報錯型別(報錯速查)JavaScript型別
- 儲存富文字文字內容太多,提示nginx 414 Request-URI Too Large及tomcat報錯NginxTomcat
- 【Spring】內嵌Tomcat&去Xml&除錯MvcSpringTomcatXML除錯MVC
- tomcat+dreamweaver中提示找不到頁面的錯誤Tomcat
- springcloud報錯報UnsatisfiedDependencyExceptionSpringGCCloudException
- pnpm 報錯NPM
- 報錯集
- Jenkins報錯Jenkins
- 報錯+2
- playsound報錯
- 前端報錯前端
- dhcp報錯
- 報錯集合
- mybatis報錯MyBatis
- modprobe報錯
- JavaScript報錯JavaScript
- redis報錯Redis
- hive 報錯Hive