ANTS Performance Profiler

Latest version: 7.4

ANTS Performance Profiler

Knowledge Base

Explanation of "thread blocked" methods in ANTS Profiler

Category: Troubleshooting & error messages
Date: 17 Jun 2009
Product: ANTS Performance Profiler
When viewing the call tree in the ANTS Performance Profiler results, "thread blocked" may appear as one of the hot stack traces, or other "thread blocked" messages may appear.

Sometimes it may seem that most of the time taken in an application, according to ANTS Profiler, is taken by blocking. This may indicate a problem that needs to be solved, but in most cases, it does not.

ANTS Profiler reports a "Thread Blocked" whenever a thread is not scheduled to run on the CPU. There are many possible situations that will cause ANTS Profiler to detect a blocked thread.

  · When timers are waiting for their "Elapsed" event to be triggered
  · When a thread is waiting for another thread to complete (Thread.Join(), for instance)
  · When the thread is waiting for the end of an object lock (lock, Monitor.Enter(), Monitor.Exit())
  · When a garbage collection is initiated on a thread that is suspended by another thread
  · When a synchronous IO operation is happening on a thread, such as a Socket.Recieve()

In most of these cases, you may not have a problem in your application's code, but rather resource problems such as a high-latency network or a low-memory condition. In some cases, it may be worth considering a change in the program's architecture. For instance, if the perceived problem seems to be related to object locks, a more asynchronous design or some sort of message queuing architecture may improve the application throughput.

Document ID: KB200902000357 Keywords: ANTS,Profiler,thread,blocked

Was this article helpful?

Search support
Forums

ANTS Performance Profiler

all products