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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Memory management
by sathishperl (Novice) on Nov 11, 2010 at 17:25 UTC |