Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E2D5D835 for ; Mon, 4 Mar 2013 14:23:57 +0000 (UTC) Received: (qmail 11991 invoked by uid 500); 4 Mar 2013 14:23:56 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 11945 invoked by uid 500); 4 Mar 2013 14:23:56 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Delivered-To: moderator for users@activemq.apache.org Received: (qmail 90601 invoked by uid 99); 28 Feb 2013 23:49:30 -0000 X-ASF-Spam-Status: No, hits=3.0 required=5.0 tests=FORGED_YAHOO_RCVD,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Date: Thu, 28 Feb 2013 15:49:04 -0800 (PST) From: jonnyamq To: users@activemq.apache.org Message-ID: <1362095344281-4664276.post@n4.nabble.com> Subject: Memory Usage of activeMQ CPP MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Test code (pretty much stripped down version of example): int main(int argc, char* argv[] ) { activemq::library::ActiveMQCPP::initializeLibrary(); { Connection* connection; std::cout << "=====================================================\n"; std::cout << "Starting the initialized:" << std::endl; std::cout << "-----------------------------------------------------\n"; std::string brokerURI = "failover:(tcp://localhost:61616" // "?wireFormat=openwire" // "&transport.useInactivityMonitor=false" // "&connection.alwaysSyncSend=true" // "&connection.useAsyncSend=true" // "?transport.commandTracingEnabled=true" // "&transport.tcpTracingEnabled=true" // "&wireFormat.tightEncodingEnabled=true" ")"; std::cout << "connect...:" << std::endl; try { // Create a ConnectionFactory auto_ptr connectionFactory( ConnectionFactory::createCMSConnectionFactory(brokerURI)); // Create a Connection connection = connectionFactory->createConnection(); // connection->start(); } catch (CMSException& e) { e.printStackTrace(); } std::cout << "connected...:" << std::endl; sleep(10); std::cout << "cleanup...:" << std::endl; if (connection != NULL) { try { connection->close(); } catch (cms::CMSException& ex) { ex.printStackTrace(); } } // Destroy resources. try { delete connection; connection = NULL; } catch (CMSException& e) { e.printStackTrace(); } std::cout << "-----------------------------------------------------\n"; std::cout << "Finished with the example." << std::endl; std::cout << "=====================================================\n"; } activemq::library::ActiveMQCPP::shutdownLibrary(); } Looking at the memory usage in "top" PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 6413 root 20 0 *498m* 5360 3848 S 0.0 0.3 0:00.00 test VIRT memory jumps to nearly 500MB! Why? Is there something that can be done to keep this memory about the same as RES portion (which is about 5K and is probably appropriate for a program that does nothing, like the one above). If I comment out connection = connectionFactory->createConnection(); memory drops down to acceptable levels (like 50K). Memory is a constraint for me and this behavior seems wrong. As a comparison sshd runs happily with <100K of VIRT memory.... ActiveMQ-CPP should too - right? -- View this message in context: http://activemq.2283324.n4.nabble.com/Memory-Usage-of-activeMQ-CPP-tp4664276.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.