Strane hanging threads after profiling live w3wp process

maciekszmacieksz Posts: 2
edited April 15, 2015 6:56PM in ANTS Performance Profiler 9
I attached ants profiler to running w3wp process and all worked fine, however the next day process grew up to 5GB. I created a dump to see what's happening and i turns out that there are over 30 000 threads, and most (i didnt check all of them, but at least all the fit in windbg text buffer:)) of them have following stacktrace. Is it a bug? or did i misconfigured something?

00000026fd74ec10 000007fb7d10140a ntdll!RtlpWaitOnCriticalSection+0xea, calling ntdll!NtWaitForSingleObject
00000026fd74ec40 000000018006b80b RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x627b, calling ntdll!RtlAllocateHeap
00000026fd74ec70 000000018006ac73 RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x56e3, calling RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x6220
00000026fd74ec90 0000000180046113 RedGate_Profiler_Core!ANTS_Leaving_Sql+0x30a23, calling RedGate_Profiler_Core!ANTS_Leaving_Sql+0x2b3e0
00000026fd74ece0 000007fb7d0cc525 ntdll!RtlpEnterCriticalSectionContended+0x94, calling ntdll!RtlpWaitOnCriticalSection
00000026fd74ed00 0000000180044568 RedGate_Profiler_Core!ANTS_Leaving_Sql+0x2ee78, calling RedGate_Profiler_Core!ANTS_Leaving_Sql+0x2e990
00000026fd74ed20 000000018006284b RedGate_Profiler_Core!ANTS_LeavingProfilerSection+0x20ab, calling ntdll!RtlEnterCriticalSection
00000026fd74ed50 0000000180044768 RedGate_Profiler_Core!ANTS_Leaving_Sql+0x2f078, calling ntdll!RtlLeaveCriticalSection
00000026fd74ed70 000000018002e8f0 RedGate_Profiler_Core!ANTS_Leaving_Sql+0x19200, calling ntdll!RtlLeaveCriticalSection
00000026fd74eda0 0000000180031ef8 RedGate_Profiler_Core!ANTS_Leaving_Sql+0x1c808, calling RedGate_Profiler_Core!ANTS_LeavingProfilerSection+0x2080
00000026fd74ede0 000007fb731df06c clr!EEToProfInterfaceImpl::ThreadCreated+0x6c
00000026fd74ee00 000007fb72ce3735 clr!GCPreemp::GCPreemp+0xe, calling clr!GetThread
00000026fd74ee30 000007fb730853a8 clr!Thread::HasStarted+0x2546b4, calling clr!EEToProfInterfaceImpl::ThreadCreated
00000026fd74ef40 000007fb72e3198c clr!SetupThread+0x2f2, calling clr!Thread::HasStarted
00000026fd74ef70 000007fb7b5c9ba9 combase!LockEntry::ThreadInit+0x19, calling ntdll!RtlAllocateHeap
00000026fd74efa0 000007fb7b5c9e17 combase!TLSPreallocateData+0x163, calling ntdll!RtlLeaveCriticalSection
00000026fd74efd0 000007fb7b557b4b combase!CoInitializeEx+0x21b, calling KERNELBASE!FlsSetValue
00000026fd74f000 000007fb72e315bd clr!SetupThreadNoThrow+0x6f, calling clr!SetupThread
00000026fd74f040 000007fb7b557c6b combase!CoInitializeEx+0x4b, calling combase!CoInitializeEx
00000026fd74f0a0 000007fb72d6ee7e clr!ThreadpoolMgr::WorkerThreadStart+0x224, calling clr!SetupThreadNoThrow
00000026fd74f0d0 000007fb72ce3b2d clr!EEHeapFreeInProcessHeap+0x39, calling kernel32!HeapFreeStub
00000026fd74f130 000007fb72e2fcb6 clr!Thread::intermediateThreadProc+0x7d
00000026fd74f1d0 000007fb7d0c5630 ntdll!RtlAllocateHeap+0x14c, calling ntdll!_security_check_cookie
00000026fd74f270 000000018006b80b RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x627b, calling ntdll!RtlAllocateHeap
00000026fd74f280 000007fb7d0c5630 ntdll!RtlAllocateHeap+0x14c, calling ntdll!_security_check_cookie
00000026fd74f2a0 000000018006ac73 RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x56e3, calling RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x6220
00000026fd74f2c0 000007fb7d0c5630 ntdll!RtlAllocateHeap+0x14c, calling ntdll!_security_check_cookie
00000026fd74f2f0 0000000180064ea7 RedGate_Profiler_Core!ANTS_LeavingProfilerSection+0x4707, calling RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x56c4
00000026fd74f300 000000018006b80b RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x627b, calling ntdll!RtlAllocateHeap
00000026fd74f320 000007fb72bc111b wbemsvc!CRT_INIT+0x30b, calling wbemsvc!DllMain
00000026fd74f340 0000000180064471 RedGate_Profiler_Core!ANTS_LeavingProfilerSection+0x3cd1, calling RedGate_Profiler_Core!ANTS_LeavingProfilerSection+0x4320
00000026fd74f380 0000000180063182 RedGate_Profiler_Core!ANTS_LeavingProfilerSection+0x29e2, calling kernel32!TlsSetValueStub
00000026fd74f3c0 000007fb7d0c52aa ntdll!RtlDeactivateActivationContextUnsafeFast+0xf6, calling ntdll!_security_check_cookie
00000026fd74f3e0 000000018007148e RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0xbefe, calling RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0xc830
00000026fd74f3f0 000007fb7d0c535f ntdll!RtlActivateActivationContextUnsafeFast+0x93, calling ntdll!_security_check_cookie
00000026fd74f410 00000001800136b3 RedGate_Profiler_Core!ANTS_End_IncomingHttp+0x3c73, calling RedGate_Profiler_Core!ANTS_LeavingProfilerSection+0x2820
00000026fd74f440 000000018006c01b RedGate_Profiler_Core!ANTS_Leaving_WebRequest+0x6a8b, calling RedGate_Profiler_Core!ANTS_End_IncomingHttp+0x3c50
00000026fd74f450 000007fb6b5d64d2 MSVCR110_CLR0400!CrtEndBoot+0x151, calling MSVCR110_CLR0400!CrtEndBoot
00000026fd74f460 000007fb7d0cf954 ntdll!LdrpReleaseModuleEnumLock+0x1c, calling ntdll!RtlReleaseSRWLockShared
00000026fd74f480 000007fb7d0cfa0f ntdll!LdrpCallInitRoutine+0x3f
00000026fd74f490 000007fb7d0cf997 ntdll!LdrpReleaseLoaderLock+0x27, calling ntdll!LdrpReleaseModuleEnumLock
00000026fd74f4d0 000007fb7d1176b6 ntdll!LdrpInitializeThread+0x254, calling ntdll!LdrpReleaseLoaderLock
00000026fd74f5a0 000007fb7d1175eb ntdll!LdrpInitializeThread+0x189, calling ntdll!RtlActivateActivationContextUnsafeFast
00000026fd74f5a8 000007fb7d117621 ntdll!LdrpInitializeThread+0x1bf, calling ntdll!RtlDeactivateActivationContextUnsafeFast
00000026fd74f5d0 000007fb7d11737e ntdll!_LdrpInitialize+0xb2, calling ntdll!ZwTestAlert
00000026fd74f640 000007fb7d1172c8 ntdll!LdrInitializeThunk+0x18, calling ntdll!ZwContinue
00000026fd74fab0 000007fb72e2fc9f clr!Thread::intermediateThreadProc+0x66, calling clr!alloca_probe
00000026fd74faf0 000007fb7a541842 kernel32!BaseThreadInitThunk+0x1a
00000026fd74fb20 000007fb7d117509 ntdll!RtlUserThreadStart+0x1d

Comments

  • Jessica RJessica R Posts: 1,226 Rose Gold 4
    Hi macieksz,

    Apologies for the delay!

    The overhead that the profiler adds to your application can build up over time and depending on your application, profiling it for a day or even less can be enough for its resource usage to reach its limits, I'm afraid. If you do want to try profiling for a longer period of time, there are some things you can do to help keep overhead to a minimum:

    - Start off profiling with sampling or method-level timings (the lesser detailed modes of profiling)- then when you find which methods are contributing to the problem and do need to dive in deeper, you can do another session with line-level timings for only methods with source, making sure to remove all pdb files that you do not need to see the line-level timings for to conserve resources
    - From Tools>Advanced options, turn on "Simplify very complex stack traces to save memory" and "Avoid profiling extremely trivial methods"
    - From the application settings, turn on "Enable inlining" and disable "Record file I/O"
    - Disable any unnecessary performance counters

    I hope that will help! Please let me know how you get on.

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.