# of current logical Threads are increasing constantly RRS feed

  • Question

  • My colleague is working on a client/server project. The server software is listening on a particular port by using TcpListener class. At first, I finds the server software has performance problem which consumes a lot of the CPU time. After reviewing the listening method, I find the problem and suggest one solution. Suddenly, I wonder it has other problems or not? So the performance monitor sets up for monitoring memory and thread usage. As time goes by, logical threads' count and physical threads' count are increased. However, process's thread's smallest value remains the same.

    Even I read Lock and Thread Performance Counters without luck. Since the process' thread does not increased time after time and garbage collector does it job. The # of current logical threads shall keep in a range. Do I misunderstand the meaning of the current logical threads?

    Thursday, June 4, 2015 6:56 AM


  • A logical thread is a .NET Thread object. If the number of logical threads increases it's either because the thread objects cannot be collected (because, say, they're added to the list and never removed) or because the threads are created so fast that even if they finish instantly the GC can't keep up with cleanup.

    Thursday, June 4, 2015 7:55 AM