activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Warmuth (JIRA)" <j...@apache.org>
Subject [jira] Closed: (AMQCPP-289) decaf.lang.Thread doesn't free memory when phtreads used
Date Fri, 26 Feb 2010 15:08:41 GMT

     [ https://issues.apache.org/activemq/browse/AMQCPP-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Christian Warmuth closed AMQCPP-289.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1.1

With Version 3.1.1 everything works. Thanks.

> 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
>             Fix For: 3.1.1
>
>
> 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.


Mime
View raw message