in reply to Re: Memory management
in thread Memory management

I found in my application that we have created threads and which not joined anywhere.

Yes. That would cause runaway memory usage.

Whilst your solution above may work for you, there are much better ways to deal with the situation.

One possibility it to detach the threads when you create them:

threads->create( \&yourSub )->detach; ...

Now the threads will go away automatically, as soon as they end and your extra thread above will be unnecessary.

If you'd answer a few questions here, there are other, better possibilities also.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^3: Memory management
by sathishperl (Novice) on Nov 11, 2010 at 17:25 UTC

    Thanks BrowserUk, Now I am getting some more memory release. Nice information for me.