【发布时间】:2013-06-21 18:23:19
【问题描述】:
我们在 CEP 上看到内存不足错误。线程转储显示大约有 32000 个线程在监视器上休眠。此外,即使 CEP JVM 选项指定在内存不足时生成 HeapDump,我们也没有看到任何堆转储生成。 请指教。 (CEP JVM -Xms256m -Xmx1536m)
1) Cassandra 在此 CEP 上被禁用
2) CEP 版本为 2.1.0
3) CEP 前面是 WSO2 ESB(使用 BAM 中介)。
4) 除了向 CEP 发送实际的有效载荷数据外,ESB 还向 CEP 发送周期性的心跳(每 15 ec)。
5) 我们还在 ESB 上配置了 JMX 代理,它每 15 分钟监控一次 CEP(cpu/内存线程)
6) 即使指定了 -XX:HeapDumpPath= 参数,也没有找到堆转储
- 在此 OOM 之前,CEP 连续运行了 7 天。重启后,我们观察到线程数以每天大约 4000-5000 个线程的速度稳步增加
CEP 日志..
[2013-06-10 05:31:49,040] ERROR - Thread Thread[ActiveMQ InactivityMonitor WriteCheckTimer,5,main] died {org.apache.zookeeper.server.NIOServerCnxn}
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:640)
at java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(ThreadPoolExecutor.java:727)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:657)
at org.apache.activemq.transport.AbstractInactivityMonitor.writeCheck(AbstractInactivityMonitor.java:153)
at org.apache.activemq.transport.AbstractInactivityMonitor$2.run(AbstractInactivityMonitor.java:117)
at org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
[2013-06-10 05:31:49,040] ERROR - Thread Thread[ActiveMQ InactivityMonitor WriteCheckTimer,5,main] died {org.apache.zookeeper.server.NIOServerCnxn}
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:640)
at java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(ThreadPoolExecutor.java:727)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:657)
at org.apache.activemq.transport.AbstractInactivityMonitor.writeCheck(AbstractInactivityMonitor.java:153)
at org.apache.activemq.transport.AbstractInactivityMonitor$2.run(AbstractInactivityMonitor.java:117)
at org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
CEP 中配置的一些查询
<cep:query name="xxxBuildUpQuery">
<cep:expression><![CDATA[from xxxCEPIntgDataStream[interfaceInformationInterfaceName=='xxx-xxx' or interfaceInformationInterfaceName=='xxx-xxx'or
interfaceInformationInterfaceName=='xxx-xxx' or interfaceInformationInterfaceName=='xxx-xxx' or
interfaceInformationInterfaceName=='xxx-xxx' or interfaceInformationInterfaceName=='xxxx-xxx' or
interfaceInformationInterfaceName=='xxx-xxx' or
interfaceInformationInterfaceName=='xxx-xxx' ]#window.time(60000)
insert into buildUpStream interfaceInformationInterfaceName, count(interfaceInformationxxxId) as noOfInflowMsgs group by interfaceInformationInterfaceName]]></cep:expression>
<cep:output brokerName="activemqJmsBroker" topic="xxxBuildUpInfoTopic">
<cep:xmlMapping>
<xxxAnalytics>
<buildUpInfo>
<interfaceName>{interfaceInformationInterfaceName}</interfaceName>
<buildUpPerMin>{noOfInflowMsgs}</buildUpPerMin>
</buildUpInfo>
</xxxAnalytics>
</cep:xmlMapping>
</cep:output>
</cep:query>
<cep:query name="xxxQueueDepthQuery">
<cep:expression><![CDATA[from xxxIntgrQueueDepthData_v1
insert into xxxIntgrQueueDepthStream flowName,appName, queueDepth]]> </cep:expression>
<cep:output brokerName="activemqJmsBroker" topic="xxxIntgrQueueDepthTopic">
<cep:xmlMapping>
<xxxAnalytics>
<queueDepthInfo>
<flowName>{flowName}</flowName>
<appName>{appName}</appName>
<depth>{queueDepth}</depth>
</queueDepthInfo>
</xxxAnalytics>
</cep:xmlMapping>
</cep:output>
</cep:query>
<cep:query name="xxxClockDataQuery">
<cep:expression><![CDATA[from testStream
insert into testOutClockDataStream AEDateTime]]></cep:expression>
<cep:output brokerName="activemqJmsBroker" topic="xxxClockDataTopic">
<cep:xmlMapping>
<xxxClockFeed>
<data>
<XXDateTime>{XXDateTime}</XXDateTime>
</data>
</xxxClockFeed>
</cep:xmlMapping>
</cep:output>
</cep:query>
<cep:query name="xxxSimltrPaymntAvgQuery_1">
<cep:expression><![CDATA[from xxxCEPIntgDataStream#window.time(15000)
insert into xxxSimltrPymntAvgData avg(amount) as avgAmount, currency group by currency]]></cep:expression>
<cep:output brokerName="activemqJmsBroker" topic="xxxAvgPaymntDetails">
<cep:xmlMapping>
<xxxAnalytics>
<avgPaymentData>
<avgAmount>{avgAmount}</avgAmount>
<currency>{currency}</currency>
</avgPaymentData>
</xxxAnalytics>
</cep:xmlMapping>
</cep:output>
谢谢 拉吉夫·帕蒂尔
【问题讨论】:
-
是什么导致了上述内存不足的问题?
-
Rajiv,很难找到 OOM 问题的原因,只有一个例外......我们需要更多详细信息 1) 这个 OOM 发生在什么情况下 2) cassendra 是否在后台运行 3) CEP 的版本是什么? 4)有没有OOM的模式? 5)请附上堆转储(您可以在
... 找到 -
谢谢@Mohanadarshan。我已经用建议的信息编辑了帖子。请帮忙
-
@Ratha 不确定导致 OOM 的原因。我已经用其他详细信息编辑了我的帖子。流入 CEP 的数据量并不多,但我们有非常频繁地向 CEP 提供数据(每 15 秒来自 ESB 的心跳,每 15 分钟连接到 CEP 的 JMX 代理每 15 分钟连接一次内务数据)跨度>
-
是否可以附加在这种OOM情况下运行的carbon.log和相应的siddhi查询???
标签: wso2 complex-event-processing