activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter P <ppoth...@crossbeamsys.com>
Subject ActiveMQ 5.3.0 Memory Usage - Connections
Date Wed, 17 Mar 2010 21:56:08 GMT

Hi,

We are using ActiveMQ 5.3.0, with both libstomp and ActiveMQ-CPP producer
and consumer clients,
sending persistent messages to both queues and topics.  We have noticed the
amount of memory used
by ActiveMQ (reported by linux top) grows over time.

Trying to determine whether the memory grew in response to messages or
connections, we noticed
using a python script based on stomppy-2.0.4-1cb, that ActiveMQ memory grew
rather quickly when
we connected and disconnected multiple times.

Here's the basis of the script

   for i in range (0,1000) :
      conn = stomp.Connection()
      conn.set_listener('', MyListener())
      conn.start()
      conn.connect()
      conn.disconnect()

Using jmap/jhat, here's the most popular Instance Counts and Histogram prior
to running the script

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
 29892 root      19   0  823m  95m  10m S  0.0  2.4   0:07.86 java 


All Classes (excluding platform)
Class 	Instance Count 	Total Size
class [B 	6288 	7214080
class [C 	26005 	2285484
class [I 	4775 	916612
class java.lang.reflect.Method 	6971 	899259
class java.lang.Class 	4802 	691488
class java.lang.String 	25732 	514640
class [Ljava.util.HashMap$Entry; 	3240 	514504
class [S 	6384 	396498
class [Ljava.lang.Object; 	4263 	378984
class [Lorg.apache.activemq.command.DataStructure; 	2 	262160
class java.util.LinkedHashMap$Entry 	4471 	196724


Instance Counts for All Classes (including platform)
26005 instances of class [C
25732 instances of class java.lang.String
6971 instances of class java.lang.reflect.Method
6741 instances of class [Ljava.lang.Class;
6384 instances of class [S
6288 instances of class [B
5806 instances of class java.util.HashMap$Entry
4802 instances of class java.lang.Class
4775 instances of class [I
4471 instances of class java.util.LinkedHashMap$Entry
4263 instances of class [Ljava.lang.Object;




and after running the script a bunch of times




  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
29892 root      18   0  880m 153m  10m S  0.0  3.9   0:35.62 java                
Heap Histogram

All Classes (excluding platform)
Class 	Instance Count 	Total Size
class [B 	9880 	16696961
class [C 	32597 	3238584
class [I 	4823 	2948344
class java.util.concurrent.ConcurrentHashMap$Segment 	65216 	2086912
class java.util.concurrent.locks.ReentrantLock$NonfairSync 	66712 	1867936
class [Ljava.util.concurrent.ConcurrentHashMap$HashEntry; 	65216 	1570048
class [Ljava.util.HashMap$Entry; 	6575 	1022200
class java.lang.reflect.Method 	6895 	889455
class java.lang.Class 	4832 	695808
class java.lang.String 	31143 	622860
class [Ljava.util.concurrent.ConcurrentHashMap$Segment; 	4076 	586944
class org.apache.activemq.command.ActiveMQMessage 	1812 	467496
class [S 	6077 	370234
class java.util.HashMap$Entry 	11704 	327712
class [Ljava.lang.Object; 	5130 	318360
class java.net.SocksSocketImpl 	1755 	282555
class [Lorg.apache.activemq.command.DataStructure; 	2 	262160
class java.util.HashMap 	5182 	248736
class java.util.concurrent.ConcurrentHashMap 	4076 	228256
class java.util.LinkedHashMap$Entry 	4155 	182820

Instance Counts for All Classes (including platform)
66712 instances of class
java.util.concurrent.locks.ReentrantLock$NonfairSync
65216 instances of class java.util.concurrent.ConcurrentHashMap$Segment
65216 instances of class [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
32597 instances of class [C
31143 instances of class java.lang.String
11704 instances of class java.util.HashMap$Entry
9880 instances of class [B
9371 instances of class java.lang.Object
6895 instances of class java.lang.reflect.Method
6575 instances of class [Ljava.util.HashMap$Entry;
6143 instances of class [Ljava.lang.Class;
6077 instances of class [S
5182 instances of class java.util.HashMap
5130 instances of class [Ljava.lang.Object;
4832 instances of class java.lang.Class
4823 instances of class [I




Here are the diffs between our config file and activemq-demo.xml



51c51
<     <broker xmlns="http://activemq.apache.org/schema/core"
brokerName="amq-broker" useJmx="true">
---
>     <broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="amq-broker" persistent="true" useJmx="true">
68c68
<                     <policyEntry queue=">" producerFlowControl="true"
memoryLimit="5mb"/>
---
>                     <policyEntry queue=">" producerFlowControl="false"
> memoryLimit="5mb"/>
76a77,79
>                         <messageEvictionStrategy>
>                              <oldestMessageEvictionStrategy/>
>                         </messageEvictionStrategy>
81d83
<                             -->
82a85,87
>                             <timedSubscriptionRecoveryPolicy
> recoverDuration="60000" /> 
>                             -->
>                             <fixedCountSubscriptionRecoveryPolicy 
> maximumSize="300" /> 
83a89
> 
88a95,96
> 
> 
197c205
<             <!-- Create a TCP transport that is advertised on via an IP
multicast 
---
>             <!-- Create a TCP transport that is NOT advertised on via an
> IP multicast 
199c207
<             <transportConnector name="openwire"
uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
---
>             <transportConnector name="openwire"
> uri="tcp://localhost:61616?transport.keepAliveResponseRequired=true;wireFormat.tcpNoDelayEnabled=true"/>
204c212
<             <transportConnector name="stomp"
uri="stomp://localhost:61613"/>
---
>             <transportConnector name="stomp"
> uri="stomp://localhost:61613?wireFormat.tcpNoDelayEnabled=true"/>
208a217,219
> 
> 
> 
325c336,337
< </beans>
\ No newline at end of file
---
> 
> </beans>


Checking the ActiveMQ 5.3.1 Fixed Issues page

     http://issues.apache.org/activemq/browse/AMQ/fixforversion/12183

this sounds different from any issue.

We run with only a single instance of ActiveMQ.

Are there any configuration parameters that controls this behavior?
Does ActiveMQ normally grow this large, cleaning up periodically?

Is this normal behavior?  Is there something I should be looking for?

Thanks,

Peter P


-- 
View this message in context: http://old.nabble.com/ActiveMQ-5.3.0-Memory-Usage---Connections-tp27937810p27937810.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message