1. 程式人生 > >HTTP Status 500 - javax servlet ServletException java lang

HTTP Status 500 - javax servlet ServletException java lang

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!

                       

詳細錯誤資訊


HTTP Status 500 - javax.servlet.ServletException
: java.lang.OutOfMemoryError: PermGen spacetype Exception reportmessage javax.servlet.ServletException: java.lang.OutOfMemoryError: PermGen spacedescription The server encountered an internal error that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException: javax.servlet
.ServletException: java.lang.OutOfMemoryError: PermGen space    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)    org.apache.jasper
.servlet.JspServlet.serviceJspFile(JspServlet.java:390)    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)    com.auth.filter.AuthorizationFilter.doFilterInternal(AuthorizationFilter.java:77)    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)    com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:115)    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)root causejavax.servlet.ServletException: java.lang.OutOfMemoryError: PermGen space    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)    org.apache.jsp.index_jsp._jspService(index_jsp.java:1102)    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)    com.auth.filter.AuthorizationFilter.doFilterInternal(AuthorizationFilter.java:77)    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)    com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:115)    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)root causejava.lang.OutOfMemoryError: PermGen space    java.lang.Class.getDeclaredConstructors0(Native Method)    java.lang.Class.privateGetDeclaredConstructors(Unknown Source)    java.lang.Class.getConstructor0(Unknown Source)    java.lang.Class.newInstance(Unknown Source)    org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:120)    org.apache.jsp.index_jsp._jspx_meth_c_005fset_005f0(index_jsp.java:1115)    org.apache.jsp.index_jsp._jspService(index_jsp.java:85)    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)    com.auth.filter.AuthorizationFilter.doFilterInternal(AuthorizationFilter.java:77)    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)    com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:115)    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)note The full stack trace of the root cause is available in the Apache Tomcat/7.0.54 logs.Apache Tomcat/7.0.54
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78

PermGen space


PermGen space的全稱是Permanent Generation space,是指記憶體的永久儲存區域OutOfMemoryError: PermGen space從表面上看就是記憶體益出,解決方法也一定是加大記憶體。說說為什麼會記憶體益出:這一部分用於存放Class和Meta的資訊,Class在被 Load的時候被放入PermGen space區域,它和和存放Instance的Heap區域不同,GC(Garbage Collection)不會在主程式執行期對PermGen space進行清理,所以如果你的APP會LOAD很多CLASS的話,就很可能出現PermGen space錯誤。這種錯誤常見在web伺服器對JSP進行pre compile的時候。

解決方法


只需要在Tomcat的bin目錄下的“catalina.sh”檔案中新增一行就可以解決問題

JAVA_OPTS='-Xms512m -Xmx2048m -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=256m'
   
  • 1

具體位置如下圖:

這裡寫圖片描述

這裡寫圖片描述

           

給我老師的人工智慧教程打call!http://blog.csdn.net/jiangjunshow

這裡寫圖片描述