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.

Comments

Popular posts from this blog

Enable Visual Studio to use more than 2GB of memory

Firefox and Chrome dark mode

Late 2008 Macbook only giving 1.5 gb/s speed with 6 gb/s Intel SSD?