Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B9ED918B for ; Sat, 15 Oct 2011 09:47:01 +0000 (UTC) Received: (qmail 17173 invoked by uid 500); 15 Oct 2011 09:47:00 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 16989 invoked by uid 500); 15 Oct 2011 09:46:43 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 16936 invoked by uid 99); 15 Oct 2011 09:46:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Oct 2011 09:46:33 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Oct 2011 09:46:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B2631309E1D for ; Sat, 15 Oct 2011 09:46:11 +0000 (UTC) Date: Sat, 15 Oct 2011 09:46:11 +0000 (UTC) From: "Hariharan (Created) (JIRA)" To: dev@activemq.apache.org Message-ID: <563993868.16880.1318671971732.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (AMQ-3545) JmstTemplate does not close connections even with PooledConnectionFactory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 JmstTemplate does not close connections even with PooledConnectionFactory ------------------------------------------------------------------------- Key: AMQ-3545 URL: https://issues.apache.org/jira/browse/AMQ-3545 Project: ActiveMQ Issue Type: Bug Components: Broker Reporter: Hariharan Hi, We use AMQ broker 5.5 and Spring 3.0 for configuring connection factory and other stuffs. The connection factory we are using is PooledConnectionFactory and a part of my config looks like this: A few days back our broker crashed and kept restarting with this error: # java.lang.OutOfMemoryError: requested 369384 bytes for Chunk::new. Out of swap space? At that point of time, from jconsole, I could not find anything unusual with the broker, except that one of our client application which talks with the server (via broker) by sending and listening to messages every *minute* had created ~3000 connections (saw it on jconsole). Once we had shut it down, everything was back to normal. So, to avoid this I tried closing the connection in finally block doing something like this. try { connection = myJmsTemplate.getConnectionFactory().createConnection(); session = connection.createSession(false, 1); String messageSelector = "JMSCorrelationID='" + correlationId + "'"; responseConsumer = session.createConsumer(receiveDestination, messageSelector); LOG.info("Starting connection"); connection.start(); myJmsTemplate.send(sendDestination, new SimpleTextMessageCreator( message, receiveDestination, correlationId)); LOG.info("Waiting for message with " + messageSelector + " for " + DEFAULT_TIMEOUT + " ms"); TextMessage responseMessage = (TextMessage) responseConsumer.receive(DEFAULT_TIMEOUT); } catch (Someexception e) {do something} finally { responseConsumer.close(); session.close(); connection.close(); } But even then I can see the connections floating around in jconsole and are only lost if the client app which publishes the messages is brought down. Can someone please help me understand what's happening here and how I can close the connections after each pub sub cycle. Thank you in advance, Hari -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira