Does threads remove themselves from memory after finished running?

755 views Asked by At

I have an application which creates 300-400 threads. Every thread has a different job to be done, nobody knows when they are going to end. So I've joined them to make my application wait for every thread to end. But when i run the software and track how many threads are running, even thread numbers are declining, my applications size in memory still gets bigger. So i wonder if threads clean-up after themselves in Ruby 1.9.2, and if they are not, what can i do about this?

1

There are 1 answers

3
Sergio Tulentsev On BEST ANSWER

As far as I know Ruby (MRI) doesn't release memory back to the system once it allocates some.

It can re-use it, but the memory isn't freed until process terminates.