activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From utuba <matt.j.t...@gmail.com>
Subject Memory leak in Text Message send
Date Thu, 12 Oct 2006 09:14:05 GMT

I have a problem when running a simple send text message.  Activemq is
producing a memory leak which causes an eventual heap overflow.  Using the
"Yourkit" profiler.  I've attached the memory recording to this mail, hope
this helps, seem to be something rooted in the JMSStatsImpl class, finally
ending in the DelayQueue.

http://www.nabble.com/file/3607/Bootstrap.memory.gz Bootstrap.memory.gz 

        try
		{
			Connection connection = connectionFactory.createConnection();
			connection.start();

			// Create a Session
			Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);

			// Create the destination (Topic or Queue)
			Destination destination = session.createQueue("TEST2.FOO");

			// Create a MessageProducer from the Session to the Topic or Queue
			MessageProducer producer = session.createProducer(destination);
			producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

			// Create a messages
			TextMessage textMessage = session.createTextMessage(message);

			// Tell the producer to send the message
			producer.send(textMessage);

			// Clean up
			producer.close();
			session.close();
			connection.stop();
			connection.close();
			
			producer = null;
			session = null;
			connection = null;
			
			return true;
		}
		catch (JMSException exception)
		{
			log.error("Error with jms"+exception);
			return false;
		}


Hope this helps,

Matt.
-- 
View this message in context: http://www.nabble.com/Memory-leak-in-Text-Message-send-tf2429089.html#a6772715
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message