0

我正在创建一个 ruleApp 并将其部署到 Rule Execution 服务器中。在执行规则时,它开始抛出 OutOfMemory 错误。

000000bd execution     E   The interaction ruleEngine.execute has failed.
                                 com.ibm.rules.res.xu.internal.LocalizedResourceException: GBRXU0001E: The interaction ruleEngine.execute has failed.
        at com.ibm.rules.res.xu.client.internal.jca.XUInteraction.execute(XUInteraction.java:302)
        at com.ibm.rules.res.xu.client.internal.XUSession.executeOperation(XUSession.java:171)
        at com.ibm.rules.res.xu.client.internal.XURuleEngineSession.execute(XURuleEngineSession.java:603)
        at ilog.rules.res.session.impl.IlrStatefulSessionBase.execute(IlrStatefulSessionBase.java:725)
        at ilog.rules.res.session.impl.IlrStatefulSessionBase.execute(IlrStatefulSessionBase.java:714)
        at ilog.rules.res.session.impl.IlrStatefulSessionBase.execute(IlrStatefulSessionBase.java:625)
        at ilog.rules.res.session.impl.IlrStatefulSessionBase.execute(IlrStatefulSessionBase.java:269)
        at ilog.rules.res.session.impl.IlrStatefulSessionBase.execute(IlrStatefulSessionBase.java:241)
        at ilog.rules.res.session.impl.IlrStatelessSessionBase.execute(IlrStatelessSessionBase.java:63)
        at com.bnsf.rules.services.framework.RuleExecutioner.invokeRuleService(RuTioner.java:50)
        at com.bnsf.rules.services.framework.RuleExecutioner.invokeSimpleRuleService(RuTioner.java:24)
        at com.bnsf.rules.services.MiscBillingRuleService.execBatch(Miservice.java:222)
        at com.bnsf.rules.services.MiscBillingRuleService.performTask(MisService.java:158)
        at com.bnsf.rules.services.MiscBillingRuleService.execute(MisService.java:88)
        at com.bnsf.rules.services.MiscBillingRuleServiceThread.run(MisThread.java:60)
Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.lang.StringBuffer.ensureCapacityImpl(StringBuffer.java:338)
        at java.lang.StringBuffer.append(StringBuffer.java:204)
        at java.io.StringWriter.write(StringWriter.java:113)
        at java.io.StringWriter.append(StringWriter.java:155)
        at com.ibm.rules.res.xu.engine.de.internal.DEManager.note(DEManager.java:554)
        at com.ibm.rules.engine.runtime.impl.EngineObserverManager.note(EngineObserverManager.java:84)
        at com.ibm.rules.engine.rete.runtime.AbstractReteEngine.note(AbstractReteEngine.java:686)
       at com.ibm.rules.generated.EngineDataClass.ilog_rules_brl_System_printMessage_java_lang_String(Unknown Source)
        at com.ibm.rules.generated.ruleflow.Service$0020Definition.IntermediateDefnFlow$003eIntermediate$0020Event$0020Definition.BodyExecEnv.executeIntermediate$0020Events$0020For$0020Intra$002dplant$0020Switch$002dEndEventBody3(Unknown Source)
        at com.ibm.rules.generated.ruleflow.Service$0020Definition.IntermediateDefnFlow$003eIntermediate$0020Event$0020Definition.BodyExecEnv.executeB

我在每个规则中都使用了 print 语句,所以错误是否意味着 print 语句正在填满我的应用程序的堆内存。此外,错误消息显示规则集中的特定包。仅从该包中删除打印语句将解决此问题。

4

1 回答 1

0

可能是 Java 堆太小而无法运行您的应用程序,但此错误的典型原因是规则中的无限循环。您(或管理员)可以验证 WebSphere 配置选项是否指定了合理的堆大小。

另一种可能性是其他一些应用程序正在使用所有堆空间——我当前的组织必须每周重新启动他们的开发服务器,以从他们尚未发现的内存泄漏中恢复堆空间。在这种情况下,规则执行得很好,但是在 RES 的决策仓库中查看(大)决策跟踪时,有时会出现堆空间不足的错误。

于 2018-02-02T19:59:41.617 回答