One Star

Why does my Karaf container slowly overwhelm the server?

Hi, I'm running the Talend Runtime karaf container from Talend ESB r101800 v.5.3.0 with these features installed and running (see attached).
I'm running one ActiveMQ broker, 4 jobs that produce ActiveMQ messages and 4 that consume them.
No matter how large I make $JAVA_MAX_MEM, eventually the container occupies all the memory allotted to it, the web consoles become slow and eventually unresponsive. After that, processing of messages stops altogether and I have to force kill the container and restart it.
What I've noticed when checking the ActiveMQ queue stats (activemq:query -QQueue=*) is that some of my queues have a constantly growing ProducerCount number. I don't know if that's related.
Also attached is my ActiveMQ configuration XML.
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
xmlnsSmiley Surprisedsgi=""
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="" brokerName="ESB-MSH-01" dataDirectory="${}/activemq/ESB-MSH-01" useShutdownHook="false" startAsync="true">
For better performances use VM cursor and small memory limit.
For more information, see:

Also, if your producer is "hanging", it's probably due to producer flow control.
For more information, see:

<policyEntry topic=">" producerFlowControl="true" memoryLimit="1mb">
<vmCursor />
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
<!-- Use VM cursor for better latency
For more information, see:

<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
<managementContext createConnector="false"/>
Configure message persistence for the broker. The default persistence
mechanism is the KahaDB store (identified by the kahaDB tag).
For more information, see:
<kahaDB directory="${}/activemq/ESB-MSH-01/kahadb"/>
The systemUsage controls the maximum amount of space the broker will
use before slowing down producers. For more information, see:

<memoryUsage limit="20 mb"/>
<storeUsage limit="1 gb" name="foo"/>
<tempUsage limit="100 mb"/>
<bean xmlns="" id="hook" class="org.apache.activemq.hooks.SpringOsgiContextHook" />
<!-- The transport connectors ActiveMQ will listen to -->
<transportConnector name="openwire" uri="tcp://"/>
<transportConnector name="stomp" uri="stomp://"/>
<bean id="activemqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://" />
<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="maxConnections" value="8" />
<property name="connectionFactory" ref="activemqConnectionFactory" />
<bean id="resourceManager" class="org.apache.activemq.pool.ActiveMQResourceManager" init-method="recoverResource">
<property name="transactionManager" ref="transactionManager" />
<property name="connectionFactory" ref="activemqConnectionFactory" />
<property name="resourceName" value="activemq.ESB-MSH-01" />
<osgi:reference id="transactionManager" interface="javax.transaction.TransactionManager" />
<osgi:service ref="pooledConnectionFactory">
<entry key="name" value="ESB-MSH-01"/>

Apache ServiceMix :: Bundles :: jdom (
Apache ServiceMix :: Bundles :: dom4j (
Apache MINA Core (2.0.5)
Apache CXF Compatibility Bundle Jar (2.7.3)
camel-core (2.10.4)
camel-karaf-commands (2.10.5.SNAPSHOT)
camel-spring (2.10.4)
camel-blueprint (2.10.4)
camel-cxf-transport (2.10.4)
camel-cxf (2.10.4)
Commons Pool (1.6.0)
camel-jms (2.10.4)
OPS4J Pax Web - Jsp Support (1.1.12)
Commons JXPath (1.3)
Service Activity Monitoring :: Common (5.3.0)
Service Activity Monitoring :: Agent (5.3.0)
Talend :: ESB :: Job :: API (5.3.0)
Talend :: ESB :: LOCATOR :: AUTH (5.3.0)
Hosts: 194
ZooKeeper Bundle (3.3.6)
Fragments: 193
Service Locator Client for CXF (5.3.0)
Apache ServiceMix :: Bundles :: jaxen (
Talend :: ESB :: Job :: Controller (5.3.0)
Commons Net (3.1.0)
Apache ServiceMix :: Bundles :: jsch (
camel-ftp (2.10.4)
Camel Talend Job Component (5.3.0)
Jolokia Agent (1.0.4)
geronimo-j2ee-management_1.1_spec (1.0.1)
Commons Codec (1.4)
Apache ServiceMix :: Bundles :: velocity (
Apache ServiceMix Bundles: oro-2.0.8 (
Apache ServiceMix :: Bundles :: jasypt (
Apache ServiceMix :: Bundles :: xpp3 (
Apache ServiceMix Bundles: dom4j-1.6.1 (
Apache ServiceMix Bundles: xstream-1.3 (
Apache Aries Transaction Manager (0.3.0)
activemq-core (5.7.0)
kahadb (5.7.0)
activemq-console (5.7.0)
activemq-ra (5.7.0)
activemq-pool (5.7.0)
activemq-karaf (5.7.0)
Apache XBean :: Spring (3.11.1)
activemq-spring (5.7.0)
activemq-web-console (5.7.0)
MyProducer0 (1.9)
MyConsumer1 (0.7)
MyProducer1 (0.3)
MyJob0 (2.2)
ProducerConsumer2 (3.5)
Consumer3 (1.2)
MyJob1 (0.1)
ProducerConsumer4 (2.1)
StoreErrors (0.1)
Apache ServiceMix :: Bundles :: derby (
Commons DBCP (1.4)
Service Activity Monitoring :: Datasource-derby (5.3.0)
Service Activity Monitoring :: Derby Starter (5.3.0)
Apache ServiceMix :: Bundles :: oscache (
Apache ServiceMix :: Bundles :: ibatis-sqlmap (
Induction_FillBWBContainer__PROD (2.2)
One Star

Re: Why does my Karaf container slowly overwhelm the server?

I performed a diagnostic dump and found that thousands of "NonBlockingInputStreamThread" threads have been spawned, and there are more all the time. I don't really understand what these are for, but it seems wrong to me that the software would create more and more of something without deleting the old, presumably unused, ones.
Is it possible something in one of my jobs is doing this? Is it a bug in Karaf, or something else?
Community Manager

Re: Why does my Karaf container slowly overwhelm the server?

just moved your topic to the relevant Forum to give it a better visibility with the right people.
One Star

Re: Why does my Karaf container slowly overwhelm the server?

created a bug report about it:
One Star

Re: Why does my Karaf container slowly overwhelm the server?

Thanks for the attention. I was able to resolve the issue by running the container under its own user instead of root.

Re: Why does my Karaf container slowly overwhelm the server?

Hi bthompson-bwb,
Could you please open a jira issue of ESB project on Talend Bug Tracker, our ESB developer will check if it is a bug.
Best regards
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.