SYMPTOMS
A Microsoft .NET-connected application that uses the
ThreadPool object extensively (such as an ASP.NET Web application or Web service), may suddenly
experience high CPU utilization. At the same time, the application may
experience a System.InvalidOperationException error and you may receive the following error message:
There were not enough free threads in the ThreadPool object to
complete the operation.
CAUSE
You might receive this
error message in many different situations. For example, you might receive this message when applications make many outgoing asynchronous Web
requests. Also, an application may have high
CPU utilization for many reasons. However, the problem that this article describes occurs because of a contention on a specific critical
section. The CPU time is used in kernel mode.
You can determine that this problem is occurring by using the
Show Kernel Times option in Microsoft Windows Task Manager. You can also use
Performance Monitor to monitor privileged time for the process.
When the load is removed from the application, you no longer experience this problem.
You can also confirm that you have experienced this specific problem by using the WinDbg tool that is included with Microsoft Debugging Tools for Windows to debug the application. Notice that many threads appear to be
blocked on the following call stack:
NTDLL!ZwWaitForSingleObject+0xb
NTDLL!RtlpWaitForCriticalSection+0x9e
NTDLL!RtlEnterCriticalSection+0x46
mscorwks!EE_EnterCriticalSection+0xc
mscorwks!ThreadpoolMgr::WorkerThreadStart+0xad
KERNEL32!BaseThreadStart+0x52
For additional information about how to use symbolic debug information, click the following article number to view the article in the Microsoft Knowledge Base:
311503
INFO: Use the Microsoft Symbol Server to Obtain Debug Symbol Files
RESOLUTION
To resolve this problem, obtain the Visual Studio .NET Framework 1.0 Post-Service Pack 2 update package.
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
821815
FIX: Visual Studio .NET Framework 1.0 Post-S Patch That Includes Hotfix 1327 and Hotifx 1456