How to deal with the error `GC overhead limit exceeded Command deploy failed.java.lang.OutOfMemoryErro reported in the deployment application log of Baolande BES application server

When the application is deployed on the BES application server, the application is not deployed successfully. By checking the server log in the installation directory and the log content of the corresponding instance, it is found that:

server.log of the server, cat /opt/BES9/logs/server.log

####|2022-12-28 09:52:48.149|INFO|javax.enterprise.system.tools.deployment|_ThreadName=httpWorkThread-0.0.0.0-6900-40|Deploy application ntkoSignServer on target(s) `[testIns]`!|####
####|2022-12-28 09:53:50.823|ERROR|javax.enterprise.system.tools.deployment|_ThreadName=httpWorkThread-0.0.0.0-6900-40|Failure to deploy application ntkoSignServer on target(s) `testIns`!|####
com.bes.enterprise.cluster.deployment.DeploymentException: Failure to deploy application ntkoSignServer on target(s) `testIns`!
        at com.bes.enterprise.cluster.deployment.core.BaseDeploymentPhaseProcessor.getDeployFailureOnTargetsException(BaseDeploymentPhaseProcessor.java:567) ~[bes-cluster-deployment-manager.jar:?]
        at com.bes.enterprise.cluster.deployment.core.BaseDeploymentPhaseProcessor.logDeploymentPhaseProcessResult(BaseDeploymentPhaseProcessor.java:547) [bes-cluster-deployment-manager.jar:?]
        at com.bes.enterprise.cluster.deployment.core.DeployApplicationProcessor.doProcess(DeployApplicationProcessor.java:241) [bes-cluster-deployment-manager.jar:?]
        at com.bes.enterprise.cluster.deployment.core.BaseDeploymentPhaseProcessor.process(BaseDeploymentPhaseProcessor.java:177) [bes-cluster-deployment-manager.jar:?]
        at com.bes.enterprise.cluster.deployment.core.ApplicationDeploymentManager.deploy(ApplicationDeploymentManager.java:121) [bes-cluster-deployment-manager.jar:?]
        at com.bes.enterprise.cluster.admin.command.deployment.DeployApplicationCommand.handleDeploy(DeployApplicationCommand.java:335) [bes-cluster-admin-command.jar:?]
        at com.bes.enterprise.cluster.admin.command.deployment.DeployApplicationCommand.doExecute(DeployApplicationCommand.java:319) [bes-cluster-admin-command.jar:?]
        at com.bes.enterprise.cluster.command.api.BaseAdminCommand.execute(BaseAdminCommand.java:61) [bes-cluster-command-api.jar:?]
        at com.bes.enterprise.console.service.impl.AdminCommandExecutorHelper.executeAdminCommandWithResponse(AdminCommandExecutorHelper.java:191) [classes/:?]
        at com.bes.enterprise.console.service.impl.ApplicationResourceServiceImpl.deployApplication(ApplicationResourceServiceImpl.java:129) [classes/:?]
        at com.bes.enterprise.console.configurations.applications.application.action.ApplicationAction.deployApplication(ApplicationAction.java:569) [classes/:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_281]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_281]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_281]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_281]
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222) [spring-web-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) [spring-web-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:775) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:867) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [bes-embed-core.jar:?]
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:841) [spring-webmvc-4.1.9.RELEASE.jar:4.1.9.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [bes-embed-core.jar:?]
        at com.bes.enterprise.console.core.action.BaseActionFilter.doFilter(BaseActionFilter.java:145) [classes/:?]
        at com.bes.enterprise.webtier.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.core.ServletWrapperValve.invoke(ServletWrapperValve.java:198) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.core.ServletContextValve.invoke(ServletContextValve.java:96) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.core.VirtualHostValve.invoke(VirtualHostValve.java:140) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.core.ServletEngineValve.invoke(ServletEngineValve.java:87) [bes-embed-core.jar:?]
        at com.bes.enterprise.webtier.connector.CoyoteAdapter.service(CoyoteAdapter.java:370) [bes-embed-core.jar:?]
        at com.bes.enterprise.web.crane.http11.Http11Processor.service(Http11Processor.java:803) [bes-embed-core.jar:?]
        at com.bes.enterprise.web.crane.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [bes-embed-core.jar:?]
        at com.bes.enterprise.web.crane.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:822) [bes-embed-core.jar:?]
        at com.bes.enterprise.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1486) [bes-embed-core.jar:?]
        at com.bes.enterprise.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [bes-embed-core.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_281]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_281]
        at com.bes.enterprise.util.threads.WorkThread$WrappingRunnable.run(WorkThread.java:61) [bes-embed-core.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_281]
        Suppressed: com.bes.enterprise.cluster.deployment.DeploymentException: Failure to deploy application ntkoSignServer on instance testIns, the error msg is: `GC overhead limit exceeded

Command deploy failed.
`!

The main reason for the error: `GC overhead limit exceeded Command deploy failed.

Check the instance log again: cat /opt/BES9/testnode/instances/testIns/logs/server.log

 Main error message:

|##
##|2022-12-28 09:52:53.543|INFO|configuration|_ThreadID=6233;_ThreadName=bes-deployment-thread-12|Configuring enterprise application: /opt/BES9/testnode/instances/testIns/deployments/ntkoSignServer|##
##|2022-12-28 09:53:50.088|SEVERE|deployment|_ThreadID=6233;_ThreadName=bes-deployment-thread-12|GC overhead limit exceeded
com.bes.enterprise.appserv.deployment.exception.DeploymentException: GC overhead limit exceeded
        at com.bes.enterprise.appserv.deployment.AppDeployer.deployApp(AppDeployer.java:134)
        at com.bes.enterprise.appserv.deployment.AppDeployer.deployApp(AppDeployer.java:99)
        at com.bes.enterprise.appserv.deployment.handler.DeployApplicationHandler.deploy(DeployApplicationHandler.java:142)
        at com.bes.enterprise.appserv.deployment.handler.DeployApplicationHandler.doApplicationProcess(DeployApplicationHandler.java:105)
        at com.bes.enterprise.appserv.deployment.handler.AbstractApplicationHandler$1.call(AbstractApplicationHandler.java:69)
        at com.bes.enterprise.appserv.deployment.handler.AbstractApplicationHandler$1.call(AbstractApplicationHandler.java:66)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
        at com.bes.enterprise.appserv.deployment.handler.AbstractApplicationHandler$TerminableThread.run(AbstractApplicationHandler.java:177)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
|##
##|2022-12-28 10:55:14.693|INFO|configuration|_ThreadID=6247;_ThreadName=bes-deployment-thread-14|Configuring enterprise application: /opt/BES9/testnode/instances/testIns/deployments/ntkoSignServer|##
##|2022-12-28 11:01:00.215|SEVERE|deployment|_ThreadID=6247;_ThreadName=bes-deployment-thread-14|Java heap space
com.bes.enterprise.appserv.deployment.exception.DeploymentException: Java heap space
        at com.bes.enterprise.appserv.deployment.AppDeployer.deployApp(AppDeployer.java:134)
        at com.bes.enterprise.appserv.deployment.AppDeployer.deployApp(AppDeployer.java:99)
        at com.bes.enterprise.appserv.deployment.handler.DeployApplicationHandler.deploy(DeployApplicationHandler.java:142)
        at com.bes.enterprise.appserv.deployment.handler.DeployApplicationHandler.doApplicationProcess(DeployApplicationHandler.java:105)
        at com.bes.enterprise.appserv.deployment.handler.AbstractApplicationHandler$1.call(AbstractApplicationHandler.java:69)
        at com.bes.enterprise.appserv.deployment.handler.AbstractApplicationHandler$1.call(AbstractApplicationHandler.java:66)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
        at com.bes.enterprise.appserv.deployment.handler.AbstractApplicationHandler$TerminableThread.run(AbstractApplicationHandler.java:177)
Caused by: java.lang.OutOfMemoryError: Java heap space

Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
 

Caused by: java.lang.OutOfMemoryError: Java heap space
 

The solution is to modify the jvm memory size of the instance: click instance management--instance name--modify the maximum and minimum heap memory configured by jvm, usually to 8192M (of course, the size of this data should be combined with the actual memory size)

Common parameters of JVM heap memory

parameter

describe

-Xms initial size of heap memory, unit m, g

-Xmx (MaxHeapSize) the maximum allowable size of the heap memory, generally not greater than 80% of the physical memory

-XX:PermSize The initial size of non-heap memory, the general application setting is initialized to 200m, and the maximum 1024m is enough

-XX:MaxPermSize

Reference materials: JVM heap memory (heap) detailed explanation_Ordinary netizens' blog-CSDN blog_jvm heap memory

Here I set 2G, which is 2048M. What needs to be noted here is: the maximum value of the heap should be set according to the actual running memory, instead of the above-mentioned recommendation of 8192. Assuming that the memory itself is not large, then setting a large maximum value of the heap may cause other problems, such as Saying that I am stepping on the pit, my server only has 4G of memory, and then the maximum heap value set to 8G is very slow, and finally timeout directly. It needs to be determined according to the actual situation. Later, when I set it to 2G, the error of timeout will not be reported again.

Guess you like

Origin blog.csdn.net/yeyuningzi/article/details/128483118