LinkedIn
Copied!

OPS0024: Java heap out of memory

Pega Predictive Diagnostic Cloud™ (PDC) generates the OPS0024 event when the JVM cannot allocate an object because the available heap space is insufficient.

Reason for the event

PDC evaluates the exceptions that Pega Platform generates. When the JVM runs out of heap space and cannot allocate an object, the JVM generates a java.lang.OutOfMemoryError: Java heap space exception. PDC recognizes this exception, and then creates an OPS0024 event and a unique Java heap out of memory issue case for each package on which the problem occurs. The system correlates all subsequent OPS0024 events that reference this package to the same case.

The OPS0024 event also triggers a Java heap out of memory notification to all subscribed recipients for that event. For more information about notifications, see Managing notifications in Pega Predictive Diagnostic Cloud.

The Java heap might run out of memory for various reasons, for example, when your application keeps unnecessary objects in memory for too long or tries to process too much data at the same time. For more information, see the "Understand the OutOfMemoryError Exception" section of the Oracle Java online documentation.

Example message text

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Example stack trace

com.pega.pegarules.pub.PRRuntimeError: PRRuntimeError
    at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:713)
    at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivitiesAlt(PRThreadImpl.java:490)
    at com.pega.pegarules.integration.engine.internal.RuleExecutionUtils.runServiceActivity(RuleExecutionUtils.java:436)
    at com.pega.pegarules.integration.engine.internal.services.ServiceAPI.runActivities(ServiceAPI.java:1927)
    at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequestInner(EngineAPI.java:438)
    at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1382)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1114)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:968)
    at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequest(EngineAPI.java:361)
    at com.pega.pegarules.integration.engine.internal.services.StatelessServiceAPI.processRequest(StatelessServiceAPI.java:51)
    at com.pega.pegarules.integration.engine.internal.services.http.HTTPService.invoke(HTTPService.java:540)
    at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl._invokeEngine_privact(EngineImpl.java:331)
    at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:274)
    at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:251)
    at com.pega.pegarules.priv.context.JNDIEnvironment.invokeEngineInner(JNDIEnvironment.java:275)
    at com.pega.pegarules.priv.context.JNDIEnvironment.invokeEngine(JNDIEnvironment.java:220)
    at com.pega.pegarules.web.impl.WebStandardImpl.makeEtierRequest(WebStandardImpl.java:749)
    at com.pega.pegarules.web.impl.WebStandardImpl.doPost(WebStandardImpl.java:413)
    at sun.reflect.GeneratedMethodAccessor125.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:381)
    at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingThrowable(PRBootstrap.java:422)
    at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingThrowable(AppServerBridgeToPega.java:224)
    at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethod(AppServerBridgeToPega.java:273)
    at com.pega.pegarules.internal.web.servlet.WebStandardBoot.doPost(WebStandardBoot.java:141)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    at com.pega.pegarules.internal.web.servlet.WebStandardBoot.service(WebStandardBoot.java:167)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1139)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2555)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2544)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3332)
    at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
    at java.lang.StringBuilder.append(StringBuilder.java:136)
    at com.pega.pegarules.priv.integration.xml.XMLDataModelHandler.characters(XMLDataModelHandler.java:293)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.characters(AbstractSAXParser.java:546)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:455)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
    at com.pega.pegarules.integration.engine.internal.mapping.ParseRuleUtils.invokeXMLParseRuleUsingNewAssembly(ParseRuleUtils.java:488)
    at com.pega.pegarules.integration.engine.internal.mapping.ParseRuleUtils.invokeXMLParseRule(ParseRuleUtils.java:233)
    at com.pega.pegarules.integration.engine.internal.util.PRParseUtils.parseXML(PRParseUtils.java:119)
    at com.pegarules.generated.activity.ra_action_parsemrucacheusage_135a7f997f7ed04cfe4b1cb13224022b.step5_circum0(ra_action_parsemrucacheusage_135a7f997f7ed04cfe4b1cb13224022b.java:592)
    at com.pegarules.generated.activity.ra_action_parsemrucacheusage_135a7f997f7ed04cfe4b1cb13224022b.perform(ra_action_parsemrucacheusage_135a7f997f7ed04cfe4b1cb13224022b.java:150)
    at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2695)
    at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:646)
    at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivitiesAlt(PRThreadImpl.java:490)
    at com.pega.pegarules.integration.engine.internal.RuleExecutionUtils.runServiceActivity(RuleExecutionUtils.java:436)
    at com.pega.pegarules.integration.engine.internal.services.ServiceAPI.runActivities(ServiceAPI.java:1927)
    at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequestInner(EngineAPI.java:438)
    at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1382)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1114)
    at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:968)
    at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequest(EngineAPI.java:361)
    at com.pega.pegarules.integration.engine.internal.services.StatelessServiceAPI.processRequest(StatelessServiceAPI.java:51)

Recommended next steps

If the Java heap on a server runs out of memory, you must take into account that the server is unstable and proceed to immediately restart the server, because this issue stops the execution of your application. To resolve such issues, engage your support team. If you are a Pega Cloud® Services client, contact Pega Support.

To investigate the issue further, perform the following steps:

  • Examine the alerts for excessive numbers of input/output (I/O) operations, excessive page group size, and memory collection alerts by viewing the events in PDC.
    • In the OPS0024 case overview in PDC, on the Stack Trace tab, analyze the stack trace of the exception.
    • Search for PEGA0028: GC cannot reclaim memory from memory pools alerts by using the Event Viewer in PDC.
  • Improve your knowledge about the memory usage of your system:
  • To perform a more detailed and comprehensive investigation, analyze the heap dump.
Suggest Edit

Related Content

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.