Brian

23%
Flag icon
Another variation is for threads to kill and re-create themselves periodically so that they remain “fresh.” This mitigates memory leaks and other problems, but in doing so hides them and makes them more difficult to find.
Brian
Should you leave a few threads/workers intact for a longer period to reveal memory leaks? Use them as canaries?
Chet
· Flag
Chet
It'll take longer to find a leak if it exists. I think it's more infuriating from a debugging perspective.

Given 10 threads. You recreate 9 regularly. You keep 1 alive forever. How long will it take th…
Brian
· Flag
Brian
You could see the memory footprint time series diverge between the 9 (sawtooth) and the 1 (linear, or seemingly flat). Or at least see an absolute difference in memory usage. If the memory leak is pro…
Brian
· Flag
Brian
And this could still work with bounce deployments (thread would appropriately be killed and recreated)--can't be running old code! :)
Practice of Cloud System Administration, The: DevOps and SRE Practices for Web Services, Volume 2
Rate this book
Clear rating
Open Preview