title: .NET Finalizer queue, stuck eating CPU
body: <p>I have a managed app and long time after I perform an activity I persistently see (in process explorer) that fallowing stack eats up CPU:</p>
  
  <pre><code>ntoskrnl.exe!memset+0x64a
  ntoskrnl.exe!KeWaitForMultipleObjects+0xd52
  ntoskrnl.exe!KeWaitForMutexObject+0x19f
  ntoskrnl.exe!__misaligned_access+0xba4
  ntoskrnl.exe!__misaligned_access+0x1821
  ntoskrnl.exe!__misaligned_access+0x1a97
  clr.dll!@RtlDecodeUtf16LE@8+0x1a
  clr.dll!_RtlCompareEncodedLBlobs@24+0xbc
  clr.dll!_RtlCompareLUnicodeStrings@16+0x1b
  clr.dll!?UpdateDerivedData@CInternalIdentityAttribute@@QAEJXZ+0x1fc
  clr.dll!??$id_AssignInternalAttributeFromPublicAttribute@U_IDENTITY_ATTRIBUTE@Rtl@Isolation@Windows@@@@YGJPAU_RTL_ALLOCATION_LIST@@ABU_IDENTITY_ATTRIBUTE@Rtl@Isolation@Windows@@AAVCInternalIdentityAttribute@@@Z+0x94
  clr.dll!??$id_ApplyDelta@U_IDENTITY_ATTRIBUTE@Rtl@Isolation@Windows@@P6IEPAU_RTL_ALLOCATION_LIST@@PAU_LUNICODE_STRING@@11PAX@Z@@YGJ_NPAU_RTL_ALLOCATION_LIST@@1PAU_INTERNAL_IDENTITY_TYPE@@KQAVCInternalIdentityAttribute@@PAKAAV?$CSmartArrayHolder@KVCInterna
  clr.dll!??$id_InternalBaseIdentityValue_ApplyDeltas@U_IDENTITY_ATTRIBUTE@Rtl@Isolation@Windows@@P6IEPAU_RTL_ALLOCATION_LIST@@PAU_LUNICODE_STRING@@11PAX@Z@@YGJKPAU_RTL_ALLOCATION_LIST@@PAU_INTERNAL_IDENTITY_TYPE@@PAVCInternalIdentityValue@@KQBU_IDENTITY_AT
  clr.dll!??$idapi_SetAttributeValue@U_IDENTITY_ATTRIBUTE@Rtl@Isolation@Windows@@P6IEPAU_RTL_ALLOCATION_LIST@@PAU_LUNICODE_STRING@@11PAX@Z@@YGJKU_BASE_IDENTITY@Rtl@Isolation@Windows@@PBU_IDENTITY_ATTRIBUTE@123@P6IEPAU_RTL_ALLOCATION_LIST@@PAU_LUNICODE_STRIN
  clr.dll!@RtlSetBaseIdentityAttributeValue@24+0x16
  clr.dll!@RtlSetReferenceIdentityAttributeValue@16+0x70
  clr.dll!?IReferenceIdentity_SetAttribute@CReferenceIdentity@Com@IsolationImplementation@@IAEJPBG00@Z+0xa9
  clr.dll!?SetAttribute@CReferenceIdentity_IReferenceIdentity@Com@IsolationImplementation@@MAGJPBG00@Z+0x17
  clr.dll!?GetTextualIdentity@CAssemblyName@@QAGJPAGPAKK@Z+0x3ff
  clr.dll!?GetDisplayName@CAssemblyName@@UAGJPAGPAKK@Z+0xa8
  clr.dll!?GetAssemblyNameDisplayName@FusionBind@@SGXPAUIAssemblyName@@AAVSString@@K@Z+0x4a
  clr.dll!?GetFileOrDisplayName@FusionBind@@QAEXKAAVSString@@@Z+0x6a
  clr.dll!?RaiseAssemblyResolveEvent@AppDomain@@QAEPAVAssembly@@PAVAssemblySpec@@HH@Z+0x49
  clr.dll!?ResolveAssemblyFile@AssemblySpec@@QAEPAVPEAssembly@@PAVAppDomain@@H@Z+0x26
  clr.dll!?TryResolveAssembly@AppDomain@@QAEPAVPEAssembly@@PAVAssemblySpec@@H@Z+0x77
  clr.dll!?PostBindResolveAssembly@AppDomain@@IAEHPAVAssemblySpec@@0JPAPAV2@@Z+0x8b
  clr.dll!?BindAssemblySpec@AppDomain@@UAEPAVPEAssembly@@PAVAssemblySpec@@HHPAW4StackCrawlMark@@PAUAssemblyLoadSecurity@@@Z+0x425
  clr.dll!?LoadDomainAssembly@AssemblySpec@@QAEPAVDomainAssembly@@W4FileLoadLevel@@PAUAssemblyLoadSecurity@@HHPAW4StackCrawlMark@@@Z+0x2bc
  clr.dll!?LoadAssembly@AssemblySpec@@QAEPAVAssembly@@W4FileLoadLevel@@PAUAssemblyLoadSecurity@@HHPAW4StackCrawlMark@@@Z+0x19
  clr.dll!?Load@AssemblyNative@@SIPAVObject@@PAVAssemblyNameBaseObject@@PAVStringObject@@_N22PAW4StackCrawlMark@@PAVAssemblyBaseObject@@PAV2@@Z+0x297
  mscorlib.ni.dll+0x24e713
  mscorlib.ni.dll+0x24e4ea
  mscorlib.ni.dll+0x23d314
  mscorlib.ni.dll+0x23cf95
  mscorlib.ni.dll+0x23cd51
  mscorlib.ni.dll+0x23caba
  mscorlib.ni.dll+0x246619
  System.ServiceModel.ni.dll+0x3113af
  System.ServiceModel.ni.dll+0x30f3b7
  System.ServiceModel.ni.dll+0x30f10e
  System.ServiceModel.ni.dll+0x30ee1c
  System.ServiceModel.ni.dll+0x30dccf
  System.ServiceModel.ni.dll+0x2fb330
  System.ServiceModel.ni.dll+0xbbc761
  System.ServiceModel.ni.dll+0xbbc7d2
  clr.dll!_CallDescrWorker@20+0x33
  clr.dll!_CallDescrWorkerWithHandler@24+0x8e
  clr.dll!?CallDescr@MethodDesc@@AAE_KPBEPAVMetaSig@@PB_KHH@Z+0x194
  clr.dll!?CallTargetWorker@MethodDesc@@AAE_KPBEPAVMetaSig@@PB_KH@Z+0x21
  clr.dll!?Call_RetArgSlot@MethodDescCallSite@@QAE_KPB_K@Z+0x1c
  clr.dll!?ExecuteCodeWithGuaranteedCleanupHelper@@YGXPAUECWGC_GC@@@Z+0xbb
  clr.dll!?ExecuteCodeWithGuaranteedCleanup@ReflectionInvocation@@SIXPAVObject@@00@Z+0x138
  mscorlib.ni.dll+0x234cba
  mscorlib.ni.dll+0x272b66
  mscorlib.ni.dll+0x2723f3
  mscorlib.ni.dll+0x272299
  clr.dll!_CallDescrWorker@20+0x33
  clr.dll!_CallDescrWorkerWithHandler@24+0x8e
  clr.dll!?CallDescr@MethodDesc@@AAE_KPBEPAVMetaSig@@PB_KHH@Z+0x194
  clr.dll!?CallTargetWorker@MethodDesc@@AAE_KPBEPAVMetaSig@@PB_KH@Z+0x21
  clr.dll!?QueueUserWorkItemManagedCallback@@YGXPAX@Z+0x4b
  clr.dll!?**DoExtraWorkForFinalizer**@Thread@@QAEXXZ+0x114
  clr.dll!?ShouldChangeAbortToUnload@Thread@@QAEHPAVFrame@@0@Z+0x101
  clr.dll!?ShouldChangeAbortToUnload@Thread@@QAEHPAVFrame@@0@Z+0x399
  clr.dll!?ShouldChangeAbortToUnload@Thread@@QAEHPAVFrame@@0@Z+0x43a
  clr.dll!?ThreadPool@ManagedThreadBase@@SGXUADID@@P6GXPAX@Z1@Z+0x15
  clr.dll!?DispatchWorkItem@ManagedPerAppDomainTPCount@@UAEXPA_N0@Z+0xe6
  clr.dll!?NewWorkerThreadStart@ThreadpoolMgr@@CGKPAX@Z+0x20b
  clr.dll!?WorkerThreadStart@ThreadpoolMgr@@CGKPAX@Z+0x3d1
  clr.dll!?intermediateThreadProc@Thread@@CGKPAX@Z+0x4b
  KERNEL32.dll!@BaseThreadInitThunk@12+0xe
  ntdll.dll!___RtlUserThreadStart@8+0x70
  ntdll.dll!__RtlUserThreadStart@8+0x1b
  </code></pre>
  
  <p>Any hints on what might cause this based on the call stack ?</p>