在安装.net 4.6之后,我的一个项目的性能出现了严重问题。它在以下情况下再现,当程序是海量数据处理并且在某一时刻分配大约4千兆字节的大量存储器时,该过程停止响应并且该过程执行大约90秒执行30-40分钟。如果我试图停止,调试过程中,visual studio冻结也没有显示线程调用堆栈。同时当附加到挂起进程看到调用堆栈时,可以看到进程挂起内存分配,下面的堆栈。
主线程的堆栈:
WKS::gc_heap::allocate_in_older_generation
clr.dll!WKS::gc_heap::allocate_in_older_generation()
clr.dll!WKS::gc_heap::plan_phase()
clr.dll!WKS::gc_heap::gc1()
clr.dll!WKS::gc_heap::garbage_collect()
clr.dll!WKS::GCHeap::GarbageCollectGeneration()
clr.dll!WKS::gc_heap::allocate_more_space()
clr.dll!JIT_New()
00007ffc1a87f061()
00007ffc1a87c2a0()
00007ffc1a87c3d8()
00007ffc189c8b3b()
WindowsBase.ni.dll!00007ffc75b917e3()
[Frames below may be incorrect and/or missing, no symbols loaded for WindowsBase.ni.dll] .
如果没有.net 4.6,计算机上的问题就无法重现。另外,如果我设置应用程序标志gcServer或从ANST Memory Profiler启动应用程序,则不会重现该问题,这很奇怪。
可能出现什么问题?