I have a large C# application running under mono. After the application has been running for a while the number of threads begins to increase to the point where the operating system can no longer start new processes.
Using htop
I can view a list of all the threads for my application, all one level deep under the application's process. The trouble is they all appear with an identical command to the one that launched the process, i.e. there is no way to tell what each thread is.
If in htop
I go to "Display options" -> "Show custom thread names" the thread names show as "Threadpool work".
My question is: how can I determine what is creating these threads? For example is there a mono debugging option to log the line that creates them?
Here is a similar question for Java, but I could not find one for C#.