Hello, 

My Setup
-       ActiveMQ 5.0.0.0, stand-alone out-of-the-box configuration. 
-       JDK : Sun jdk1.5.0_14 (broker and Publisher)
-       Spring 2.5 Jms Template
-       OS : Windows XP SP2

Problem : 
I get an OutOfMemory when running a simple PubSub test on ActiveMQ 5.0.0 but
not when using ActiveMQ4.1.1.

Use Case : I publish a small String message into 500 different topic avery
500 Milisec. There is no subscriber connected on the broker. 

When I connect JConsole over JMX on the broker process, the memory keep
going up and up until an out-of-memory.  If I switch to ActiveMQ 4.1.1
(stand-alone out-of-the-box configuration) I don’t have this problem. 

Here is the code that run avery 500 milisec. : 
//---------------------------------------------------
 public void run() {
                // For each Topic.
                 int max = 500;
                 String topicPrefix = "TOPIC-";
                long start = System.currentTimeMillis();
                for (int i = 0; i < max; i++) {
                        // Do the Send
                        jmsTemplate.send(topicPrefix+i,new MessageCreator() {
                                public Message createMessage(Session session) 
throws JMSException {
                                return
session.createTextMessage("TimeStamp-"+System.currentTimeMillis());
                                }
                        });
                }
                System.out.println("Done publish." + " in " 
+(System.currentTimeMillis() -
start)+" milisec.");

                }
//---------------------------------------------------


Here is my Spring config : 
//---------------------------------------------------
<bean id="jmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory"
destroy-method="stop">
    <property name="connectionFactory">
      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL">
          <value>tcp://localhost:61616</value>
        </property>
      </bean>
    </property>
  </bean>
  
 <!-- Spring JMS Template -->
  <bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">    
 
    <property name="pubSubDomain" value="true" />
    <property name="connectionFactory">
      <!-- lets wrap in a pool to avoid creating a connection per send -->
      <bean
class="org.springframework.jms.connection.SingleConnectionFactory">
        <property name="targetConnectionFactory">
          <ref local="jmsFactory" />
        </property>
      </bean>
    </property>
  </bean>
//---------------------------------------------------

Is this a Spring configuration problem or AMQ 5.0.0?


-- 
View this message in context: 
http://www.nabble.com/OutOfMemory-when-using-Topic-on-AMQ-5.0.0-but-not-on-4.1.1.-tp16120097s2354p16120097.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to