Posts

Showing posts from May, 2014

So your TPL Threads just die and no idea why?

Let us say you create a TPL thread which runs a loop inside. And you are processing a set number of items in the loop. If the processing takes time, on some servers I have observed that the thread dies after running for a very long time. And the process just enters a state where it does nothing and simply hangs on to memory. These VMs are old and slow, that could be part of the problem. To resolve this, add a time based check so that any loop won't run for more than half an hour (say). This fixed the problem for me. I was investigating this issue for months now.