activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander N>
Subject MessageServlet and Memory-/CPU-Consumption
Date Thu, 21 Jul 2011 14:27:52 GMT

I'm running ActiveMQ 5.3.2 as a server under Debian 5.0
and I'm using the REST-Servlet of the demo-webapp 
(MessageServlet) to post messsages to one queue.

The setup is quite out-of-the-box but it shows a strange
behavior when the amount of messages increases 
When I'm sending 1 messages/sec, everything works fine.
But with 50 messages/sec the ActiveMQ-Server runs out
of threads or out of memory and in the same time consumes
an essential amount of cpu-time. I configured the JVM with
2Gb of Memory but still after a certain amount of time
(a few hours) out-of-memory-Exceptions occur (for ~50 

So I've done some research (even bought the book "ActiveMQ in
Action") and came to the conclusion that this behavoir could
occur because of there is probably no pooling of connections 
done if the demo-webapp if is running outside a J2EE-environment.

So I tried to add a pooling connection factory to
activemq.xml (inspired by what is described in the book
on page 166) by adding the following beans to activemq.xml:

                  <property name="locations">
        <bean id="jmsConnectionFactory"
            <property name="brokerURL" value="tcp://locahost:61616" />
        <bean id="pooledJmsConnectionFactory"
            <property name="connectionFactory" ref="jmsConnectionFactory" />

This connection-pool I try to refernce in the web.xml of the
It looks like this:

            <description>The URL of the Message Broker to connect
            <description>Whether we should include an embedded broker or

But that doesn't seem to do the pooling-job, at least it has no
effect on memory-consumption. Appearently I'm doing sth wrong
(or even substantally wrong ;) here.

Now I have 2 questions:

1. Can the lack of connection-pooling be the reason of the extensive
memory- and cpu-consumption of the the Message-Servlet on my
(very much default) ActiveMQ-installation ?

2. Is there a way to add connection-pooling to the demo-
webapp without deploying it in a J2EE-container?

Thanx in advance for any help!

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message