Memory leaks “的实例出现内存问题”;RETEOOSTATEPULSION“重新启动”;

Memory leaks “的实例出现内存问题”;RETEOOSTATEPULSION“重新启动”;,memory-leaks,drools,jboss-rules,Memory Leaks,Drools,Jboss Rules,我使用的是jBoss规则,但我在使用jBoss规则后遇到了内存问题。使用分析工具,我收集了堆转储 我得到的结果是: One instance of "org.drools.reteoo.ReteooStatefulSession" loaded by "sun.misc.Launcher$AppClassLoader @ 0x7f899fdb6d88" occupies 657,328,888 (78.91%) bytes. The memory is accumul

我使用的是jBoss规则,但我在使用jBoss规则后遇到了内存问题。使用分析工具,我收集了堆转储 我得到的结果是:

    One instance of "org.drools.reteoo.ReteooStatefulSession" loaded by 
    "sun.misc.Launcher$AppClassLoader @ 0x7f899fdb6d88" occupies 657,328,888 (78.91%) bytes. 
    The memory is accumulated in one instance of "org.drools.reteoo.ReteooStatefulSession" 
    loaded by "sun.misc.Launcher$AppClassLoader @ 0x7f899fdb6d88". 

    Keywords 
    sun.misc.Launcher$AppClassLoader @ 0x7f899fdb6d88 
    org.drools.reteoo.ReteooStatefulSession
下面给出了我用于JBoss规则的代码

            kbase= KnowledgeBaseFactory.newKnowledgeBase(); 
            ksession= kbase.newStatefulKnowledgeSession(); 
            final String str = CISMSRemotingUtils.getFullConfigFilePath("change-set.xml") ; 
            final String filePath = str.replaceAll(" ", "%20"); 
            aconf = KnowledgeAgentFactory .newKnowledgeAgentConfiguration(); 
            aconf.setProperty("drools.agent.newInstance", "false"); 
            kagent = KnowledgeAgentFactory.newKnowledgeAgent( "Agent", aconf); 
            kagent.applyChangeSet( ResourceFactory.newFileResource(filePath) ); 
            kbase = kagent.getKnowledgeBase(); 
            ksession= kbase.newStatefulKnowledgeSession(); 
            sconf =ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration(); 
            sconf.setProperty( "drools.resource.scanner.interval", "3600"); 
            ResourceFactory.getResourceChangeScannerService().configure( sconf ); 
            ResourceFactory.getResourceChangeNotifierService().start(); 
            ResourceFactory.getResourceChangeScannerService().start(); 
这段代码在类构造函数中给出,规则在此类中激发

            ksession.insert(data); 
            ksession.fireAllRules(); 
我用的是drools 5.4.0


有人能帮我找出问题吗?

你确定有问题吗?根据您的知识库,JBoss规则会话可能会消耗相当大的内存。只要确保JVM启动时有足够的最大堆空间,这样它就不会达到内存限制(-Xmx选项)。如果不显示规则代码,就无法确定是否存在可以有效减少内存使用的优化。