You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2010/02/26 15:58:40 UTC

[jira] Commented: (AMQCPP-289) decaf.lang.Thread doesn't free memory when phtreads used

    [ https://issues.apache.org/activemq/browse/AMQCPP-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57881#action_57881 ] 

Timothy Bish commented on AMQCPP-289:
-------------------------------------

This was already addressed in V3.1.1 please give that version a try.

> decaf.lang.Thread doesn't free memory when phtreads used
> --------------------------------------------------------
>
>                 Key: AMQCPP-289
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-289
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: Decaf
>    Affects Versions: 3.1
>         Environment: Linux Ubuntu 9.10 
>            Reporter: Christian Warmuth
>            Assignee: Timothy Bish
>
> If you run the following program:
> int main (int argc, char *argv[])
> {
>   
>    ConnectionFactory* connectionFactory;
>    Connection *connection;
>    activemq::library::ActiveMQCPP::initializeLibrary();
>     
>    std::string brokerURI =
>         "tcp://127.1.0.1:61616"
>         "?wireFormat=openwire";
> 	
>    connectionFactory = ConnectionFactory::createCMSConnectionFactory( brokerURI );
>    for (int i=0;i<1000;i++)
>    {
>       connection = connectionFactory->createConnection();
>       connection->start();
>       connection->stop();
>       connection->close();
>       delete connection;
>       printf("Count %ld\r\n",i);
>    }
>      
>    delete connectionFactory;
>     
>    activemq::library::ActiveMQCPP::shutdownLibrary();
>    return 0;
> }
> the consumption of memory grows on every 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:
> #ifdef HAVE_PTHREAD_H
>         pthread_detach(properties->handle);
> #endif
> 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.