activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris W. (JIRA)" <>
Subject [jira] Created: (AMQCPP-289) decaf.lang.Thread doesn't free memory when phtreads used
Date Fri, 26 Feb 2010 14:48:40 GMT
decaf.lang.Thread doesn't free memory when phtreads used

                 Key: AMQCPP-289
             Project: ActiveMQ C++ Client
          Issue Type: Bug
          Components: Decaf
    Affects Versions: 3.1
         Environment: Linux Ubuntu 9.10 
            Reporter: Chris W.
            Assignee: Timothy Bish

If you run the following program:

int main (int argc, char *argv[])
   ConnectionFactory* connectionFactory;
   Connection *connection;

   std::string brokerURI =
   connectionFactory = ConnectionFactory::createCMSConnectionFactory( brokerURI );

   for (int i=0;i<1000;i++)
      connection = connectionFactory->createConnection();
      delete connection;
      printf("Count %ld\r\n",i);
   delete connectionFactory;
   return 0;

the consumption of memory grows on each new connection, but the memory is never freed.
After about 180 connections the maximum virtual memory (about 3GB on 32bit Linux) of the process
is reached and its impossible
to create a new thread for the client. I saw that the destructor of the Thread class is called,
but the memory of the created threads
is not freed.

If I add the line:


to the destructor of de decaf/ang/Thread class the memory is freed after destroying the connection.

This is a quick and dirty fix, but I think somewhat is going wrong here.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message