activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Turret <>
Subject JMS and ActiveMQ lingering transports and scheduler threads cause a Java out of memory error
Date Wed, 27 Jun 2007 22:09:30 GMT

 I am running Spring 2.0.5 with ActiveMQ 4.1.1 as my JMS provider under Java

I have noticed lingering ActiveMQ Transport and ActiveMQ Scheduler threads
within a running JVM via the jconsole utility. These threads are ever
increasing and never seem to be reaped by the garbage collector. I am using
a very simple send and receive queue messaging protocol.  This after a heavy
pounding of messaging will cause the ActiveMQ server to report a Java out of
memory error!!!  I have waited many minutes to see if they are release after
a long period of no activity, but to no avail.

Here are my XML config files:

<!-- A Pooled Based JMS Provider -->
<bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFa
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFacto ry">
<property name="brokerURL" value="tcp://localhost:61616"/>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsFactory"/>

Here is the code that sends and receives from the Queue:

public class TdeClient
private static String messageID = "1001";
private static Integer counter = 1;
private String myMessageID = null;

private JmsTemplate jmsTemplate = null;
private FileSystemXmlApplicationContext ctx = null;

private static final long JMS_TIMEOUT_FOREVER = -1;
private static Logger logger =

// Default Tde Request/Response Queues
private final static String requestQueue = "RequestQueue";
private final static String responseQueue = "ResponseQueue";

// Default constructor
public TdeClient()
// Setup the JMS enironment

public void setJmsTemplate(JmsTemplate jmsTemplate)
this.jmsTemplate = jmsTemplate;

// Setup the Spring bean for this class for database use
private void setup()
ctx = new FileSystemXmlApplicationContext("classpath:springB
jmsTemplate = (JmsTemplate) ctx.getBean("jmsTemplate");

// Set Receive Timeout
jmsTemplate.setReceiveTimeout(JMS_TIMEOUT_FOREVER) ;

// Send JMS requests to the default TDE Request Queue
public void send(Request req)
myMessageID = getNextJMSMessageID();

// Send Request
jmsTemplate.convertAndSend(requestQueue, req, new MessagePostProcessor()
public Message postProcessMessage(Message message) throws JMSException
return message;

logger.debug("TdeClient: Sent[" + messageID + "] Request =" + req);


// Receive JMS esponse from the default TDE Response Queue
public Response receive()
// Wait for Synchronous Response
// Use a Message Selector to only receive responses to the request you
// sent
String resSelectorId = "JMSCorrelationID='" + getCurrentJMSMessageID() +
Response resp = (Response)
jmsTemplate.receiveSelectedAndConvert(responseQueu e,

return resp;

// Create an UNIQUE message ID for the send message method
private String getNextJMSMessageID()
return messageID + counter++;

private String getCurrentJMSMessageID()
return myMessageID;

Any thoughts or suggestions are gratefully welcome!!!

Is this an issue with the configuration of the ActiveMQ product? my Spring

Thanks again!


Here is more info: [Partial Java Stack Trace]

  0x08433800 JavaThread "ActiveMQ Connection Dispatcher: 6954942" daemon
[_thread_blocked, id=185]
  0x0842fc00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=184]
  0x08397c00 JavaThread "ActiveMQ Connection Dispatcher: 25423514" daemon
[_thread_blocked, id=183]
  0x08396c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=182]
  0x08395c00 JavaThread "ActiveMQ Connection Dispatcher: 5158001" daemon
[_thread_blocked, id=181]
  0x08394c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=180]
  0x08394000 JavaThread "ActiveMQ Connection Dispatcher: 15703296" daemon
[_thread_blocked, id=179]
  0x08391c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=178]
  0x08391000 JavaThread "ActiveMQ Connection Dispatcher: 7663968" daemon
[_thread_blocked, id=177]
  0x08390800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=176]
  0x08857000 JavaThread "ActiveMQ Connection Dispatcher: 11983248" daemon
[_thread_blocked, id=175]
  0x08856400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=174]
  0x0826d800 JavaThread "ActiveMQ Connection Dispatcher: 10410271" daemon
[_thread_blocked, id=173]
  0x08853400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=172]
  0x08852c00 JavaThread "ActiveMQ Connection Dispatcher: 29244338" daemon
[_thread_blocked, id=171]
  0x08852000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=170]
  0x08638c00 JavaThread "ActiveMQ Connection Dispatcher: 1361869" daemon
[_thread_blocked, id=169]
  0x08577c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=168]
  0x083f0400 JavaThread "ActiveMQ Connection Dispatcher: 2634125" daemon
[_thread_blocked, id=167]
  0x08575800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=166]
  0x08574400 JavaThread "ActiveMQ Connection Dispatcher: 32380789" daemon
[_thread_blocked, id=165]
  0x08572c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=164]
  0x08571c00 JavaThread "ActiveMQ Connection Dispatcher: 3926741" daemon
[_thread_blocked, id=163]
  0x08626c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=162]
  0x08626000 JavaThread "ActiveMQ Connection Dispatcher: 25212153" daemon
[_thread_blocked, id=161]
  0x08625400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=160]
  0x0826d000 JavaThread "ActiveMQ Connection Dispatcher: 3447310" daemon
[_thread_blocked, id=159]
  0x08622800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=158]
  0x08622000 JavaThread "ActiveMQ Connection Dispatcher: 24230975" daemon
[_thread_blocked, id=157]
  0x0853ec00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=156]
  0x0853e400 JavaThread "ActiveMQ Connection Dispatcher: 16712249" daemon
[_thread_blocked, id=155]
  0x0853d800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=154]
  0x083ef400 JavaThread "ActiveMQ Connection Dispatcher: 18129862" daemon
[_thread_blocked, id=153]
  0x0853a800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=152]
  0x0853a000 JavaThread "ActiveMQ Connection Dispatcher: 5529961" daemon
[_thread_blocked, id=151]
  0x08539800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=150]
  0x08638800 JavaThread "ActiveMQ Connection Dispatcher: 15086783" daemon
[_thread_blocked, id=149]
  0x08232800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=148]
  0x08231800 JavaThread "ActiveMQ Connection Dispatcher: 11648722" daemon
[_thread_blocked, id=147]
  0x08230400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=146]
  0x0822f400 JavaThread "ActiveMQ Connection Dispatcher: 3764174" daemon
[_thread_blocked, id=145]
  0x0822e400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=144]
  0x084f4000 JavaThread "ActiveMQ Connection Dispatcher: 1073441" daemon
[_thread_blocked, id=143]
  0x084f2c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=142]
  0x084f1400 JavaThread "ActiveMQ Connection Dispatcher: 3622076" daemon
[_thread_blocked, id=141]
  0x084f0400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=140]
  0x084ef000 JavaThread "ActiveMQ Connection Dispatcher: 16513840" daemon
[_thread_blocked, id=139]
  0x084ee000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=138]
  0x08294400 JavaThread "ActiveMQ Connection Dispatcher: 1619090" daemon
[_thread_blocked, id=137]
  0x08293800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=136]
  0x08568c00 JavaThread "ActiveMQ Connection Dispatcher: 21869867" daemon
[_thread_blocked, id=135]
  0x08291000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=134]
  0x0828fc00 JavaThread "ActiveMQ Connection Dispatcher: 1130715" daemon
[_thread_blocked, id=133]
  0x0828ec00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=132]
  0x0828d800 JavaThread "ActiveMQ Connection Dispatcher: 27596733" daemon
[_thread_blocked, id=131]
  0x084eb400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=130]
  0x084ea800 JavaThread "ActiveMQ Connection Dispatcher: 20336357" daemon
[_thread_blocked, id=129]
  0x084e9000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=128]
  0x084e8000 JavaThread "ActiveMQ Connection Dispatcher: 16297593" daemon
[_thread_blocked, id=127]
  0x084e6400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=126]
  0x084e5400 JavaThread "ActiveMQ Connection Dispatcher: 17567655" daemon
[_thread_blocked, id=125]
  0x08809000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=124]
  0x08808400 JavaThread "ActiveMQ Connection Dispatcher: 10420192" daemon
[_thread_blocked, id=123]
  0x08807800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=122]
  0x08807000 JavaThread "ActiveMQ Connection Dispatcher: 9783727" daemon
[_thread_blocked, id=121]
  0x08805400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=120]
  0x08804c00 JavaThread "ActiveMQ Connection Dispatcher: 17624086" daemon
[_thread_blocked, id=119]
  0x0865cc00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=118]
  0x08530c00 JavaThread "ActiveMQ Connection Dispatcher: 14274282" daemon
[_thread_blocked, id=117]
  0x0865b800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=116]
  0x0865b000 JavaThread "ActiveMQ Connection Dispatcher: 14846561" daemon
[_thread_blocked, id=115]
  0x081f0800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=114]
  0x081f0000 JavaThread "ActiveMQ Connection Dispatcher: 22150794" daemon
[_thread_blocked, id=113]
  0x081ef400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=112]
  0x081eec00 JavaThread "ActiveMQ Connection Dispatcher: 28243864" daemon
[_thread_blocked, id=111]
  0x081ee000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=110]
  0x08666800 JavaThread "ActiveMQ Connection Dispatcher: 1724479" daemon
[_thread_blocked, id=109]
  0x081ebc00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=108]
  0x0820c400 JavaThread "ActiveMQ Connection Dispatcher: 13064693" daemon
[_thread_blocked, id=107]
  0x0820a000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=106]
  0x08209000 JavaThread "ActiveMQ Connection Dispatcher: 24121759" daemon
[_thread_blocked, id=105]
  0x08208000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=104]
  0x08207400 JavaThread "ActiveMQ Connection Dispatcher: 11171801" daemon
[_thread_blocked, id=103]
  0x08246400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=101]
  0x08245c00 JavaThread "ActiveMQ Connection Dispatcher: 16272138" daemon
[_thread_blocked, id=100]
  0x08245800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=99]
  0x08206000 JavaThread "ActiveMQ Connection Dispatcher: 18617180" daemon
[_thread_blocked, id=98]
  0x08243800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=71]
  0x08242800 JavaThread "ActiveMQ Connection Dispatcher: 33256805" daemon
[_thread_blocked, id=70]
  0x083d8c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=69]
  0x083d8000 JavaThread "ActiveMQ Connection Dispatcher: 15724536" daemon
[_thread_blocked, id=68]
  0x083cc400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=67]
  0x081e2c00 JavaThread "ActiveMQ Connection Dispatcher: 9089012" daemon
[_thread_blocked, id=66]
  0x08262c00 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=65]
  0x08241800 JavaThread "ActiveMQ Connection Dispatcher: 5834000" daemon
[_thread_blocked, id=64]
  0x08629800 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=54]
  0x0825e400 JavaThread "ActiveMQ Connection Dispatcher: 7477605" daemon
[_thread_blocked, id=53]
  0x08254c00 JavaThread "ActiveMQ Scheduler" daemon [_thread_blocked, id=48]
  0x0860ac00 JavaThread "ActiveMQ Scheduler" daemon [_thread_blocked, id=47]
  0x0862d400 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_blocked, id=46]
  0x084ed400 JavaThread "ActiveMQ Connection Dispatcher: 3795544" daemon
[_thread_blocked, id=45]
  0x08634c00 JavaThread "ActiveMQ Scheduler" daemon [_thread_blocked, id=42]
  0x086af000 JavaThread "ActiveMQ Scheduler" daemon [_thread_blocked, id=41]
  0x086ae000 JavaThread "ActiveMQ Transport: tcp:///" daemon
[_thread_in_native, id=40]
  0x086b0400 JavaThread "ActiveMQ Connection Dispatcher: 16900472" daemon
[_thread_blocked, id=39]
  0x086ad400 JavaThread "MulticastDiscovery: null" daemon
[_thread_in_native, id=38]
  0x086acc00 JavaThread "ActiveMQ Transport Status Monitor: stomp" daemon
[_thread_blocked, id=37]
  0x086ac400 JavaThread "ActiveMQ Transport Server: stomp://localhost:61613"
daemon [_thread_in_native, id=36]
  0x086b2000 JavaThread "ActiveMQ Transport Status Monitor: ssl" daemon
[_thread_blocked, id=35]
  0x086b1c00 JavaThread "ActiveMQ Transport Server: ssl://localhost:61617"
daemon [_thread_in_native, id=34]
  0x0868d000 JavaThread "ActiveMQ Transport Status Monitor: openwire" daemon
[_thread_blocked, id=33]
  0x0851b000 JavaThread "MulticastDiscovery: tcp://vdev2th:61616" daemon
[_thread_in_native, id=32]
  0x08795400 JavaThread "ActiveMQ Scheduler" daemon [_thread_blocked, id=30]
  0x083d0c00 JavaThread "derby.rawStoreDaemon" daemon [_thread_blocked,
  0x0837e400 JavaThread "RMI RenewClean-[]" daemon
[_thread_blocked, id=26]
  0x084f6800 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=25]
  0x083c2400 JavaThread "derby.antiGC" daemon [_thread_blocked, id=23]
  0x083c3400 JavaThread "GC Daemon" daemon [_thread_blocked, id=22]
  0x083cd800 JavaThread "RMI Reaper" [_thread_blocked, id=21]
  0x082b9000 JavaThread "RMI TCP Accept-1099" daemon [_thread_in_native,
  0x086d4000 JavaThread "ActiveMQ Journal Checkpoint Worker" daemon
[_thread_blocked, id=18]
  0x08494800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=16]
  0x0822b800 JavaThread "Low Memory Detector" daemon [_thread_blocked,
  0x08229c00 JavaThread "CompilerThread1" daemon [_thread_blocked, id=14]
  0x08228800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=13]
  0x08227400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=12]
  0x08226400 JavaThread "Surrogate Locker Thread (CMS)" daemon
[_thread_blocked, id=11]
  0x08211000 JavaThread "Finalizer" daemon [_thread_blocked, id=10]
  0x08210800 JavaThread "Reference Handler" daemon [_thread_blocked, id=9]
  0x08070400 JavaThread "main" [_thread_blocked, id=2]

Other Threads:
=>0x0820e400 VMThread [id=8]
  0x08368400 WatcherThread [id=17]

VM state:at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
[0x0806f5e0/0x0806f610] Threads_lock - owner thread: 0x0820e400

 par new generation   total 14784K, used 10833K [0xb8a00000, 0xb9a00000,
  eden space 13184K,  79% used [0xb8a00000, 0xb942d2f0, 0xb96e0000)
  from space 1600K,  25% used [0xb9870000, 0xb98d7390, 0xb9a00000)
  to   space 1600K,   0% used [0xb96e0000, 0xb96e0000, 0xb9870000)
 concurrent mark-sweep generation total 347992K, used 207382K [0xbca00000,
0xd1dd6000, 0xf7200000)
 concurrent-mark-sweep perm gen total 48380K, used 29027K [0xf7200000,
0xfa13f000, 0xfb200000)

Dynamic libraries:
0x08050000      /usr/jdk/instances/jdk1.6.0/bin/java
0xfefa0000      /lib/
0xfefb0000      /lib/
0xfee90000      /lib/
0xfe800000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/server/
0xfee50000      /lib/
0xfee70000      /usr/lib/
0xfe7d0000      /lib/
0xfe7a0000      /usr/lib/
0xfe780000      /lib/
0xfe6f0000      /lib/
0xfe680000      /lib/
0xfe650000      /lib/
0xfe620000      /lib/
0xfe600000      /lib/
0xfe5e0000      /lib/
0xfe4f0000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/
0xfe4b0000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/
0xfe470000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/
0xb6410000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/
0xb5e10000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/
0xb5dd0000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/
0xb5d80000      /usr/lib/
0xb5d60000      /usr/lib/
0xb5cc0000      /usr/lib/security/
0xb5a60000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/
0xb5a40000      /lib/
0xb5a20000      /lib/
0xb59e0000      /usr/lib/
0xb5730000      /usr/jdk/instances/jdk1.6.0/jre/lib/i386/

VM Arguments:
jvm_args: -Xincgc -Xmx1000M
java_command: /zpool1/activeMQ/apache-activemq-4.1.1/bin/run.jar
Launcher Type: SUN_STANDARD

Environment Variables:

Signal Handlers:
SIGSEGV: [], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGBUS: [], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGFPE: [], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGPIPE: [], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGILL: [], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGHUP: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGINT: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGQUIT: [], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGTERM: [], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGQUIT: [], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGTERM: [], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIG39: [], sa_mask[0]=0x00000000, sa_flags=0x00000008
SIG40: [], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c

---------------  S Y S T E M  ---------------

OS:                        Solaris 10 11/06 s10x_u3wos_10 X86
           Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                           Assembled 14 November 2006

uname:SunOS 5.10 Generic_118855-33 i86pc  (T2 libthread)
rlimit: STACK 10240k, CORE infinity, NOFILE 65536, AS infinity
load average:0.62 0.78 0.54

CPU:total 4 family 15, cmov, cx8, fxsr, mmx, sse, sse2, mmxext, 3dnowext,
3dnow, ht

Memory: 4k page, physical 16678440k(1849528k free)

vm_info: Java HotSpot(TM) Server VM (1.6.0_01-b06) for solaris-x86, built on
Mar 14 2007 00:52:55 by "" with unknown Workshop:0x580


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

View raw message