tomcat运行出现PermGen space调整JAVA_OPTS="-server -Xms1024m -Xmx2048m -XX:MaxNewSize=256m -XX:MaxPermSize=256m"没用

神手-追魂 发布于 2017/03/31 19:39
阅读 534
收藏 0

31-Mar-2017 18:53:08.456 SEVERE [http-apr-8080-exec-8] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet spring threw exception
 java.lang.OutOfMemoryError: PermGen space
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
    at java.lang.Class.getConstructor0(Class.java:2793)
    at java.lang.Class.getDeclaredConstructor(Class.java:2043)
    at net.sf.cglib.core.ReflectUtils.getConstructor(ReflectUtils.java:244)
    at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
    at net.sf.cglib.reflect.FastClass$Generator.firstInstance(FastClass.java:76)
    at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
    at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:64)
    at net.sf.cglib.proxy.MethodProxy.helper(MethodProxy.java:120)
    at net.sf.cglib.proxy.MethodProxy.init(MethodProxy.java:75)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:189)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
    at com.icoix.maiya.module.operationActive.service.impl.AppOperationActiveServiceImpl$$EnhancerByCGLIB$$68900f3b_2.queryAppOperationActiveByAccount(<generated>)
    at com.icoix.maiya.module.operationActive.controller.AppOperationActiveController.queryAppOperationActiveByAccount(AppOperationActiveController.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)

加载中
0
神手-追魂
神手-追魂

要用

set JAVA_OPTS=-server -Xms512m -Xmx1024m -XX:MaxNewSize=256m -XX:PermSize=256M -XX:MaxPermSize=512m

后面可以用echo %JAVA_OPTS%将参数输出,查看参数是否设置生效

也可以用   %JAVA_HOME%\bin\jvisualvm.exe 来检测tomcat的堆内存状态

0
Eric_林
Eric_林

看程序,看看是不是有死循环了

0
moliunian
moliunian

不是有代码定位吗?审查下该位置,存在内存泄露 

at com.icoix.maiya.module.operationActive.controller.AppOperationActiveController.queryAppOperationActiveByAccount(AppOperationActiveController.java:46)

 

返回顶部
顶部