The end queue of the queue is growing, but managed heaps are not

We have some kind of leak that I don’t understand. Heaps Gen0 / 1/2 do not increase, however the working set increases until we reach OOM.

DebugDiag tells me that CLR.DLL owns growing memory, and also says that we have a growing finalizer queue - 100 thousand thousand Texture2D objects (its XNA application), which increase over time. However, not a single profiler (dotTrace, Ants, CLR Profiler) can find these objects - they do not appear on the heap, and CLRProfiler claims that they are never allocated.

So, I look in WinDbg - again I see the growing queue of Finalizer, full of Texture2D. fReachable is empty, and it still claims that all of these objects are on the heap.

*0:038> !finalizequeue
SyncBlocks to be cleaned up: 0
MTA Interfaces to be released: 0
STA Interfaces to be released: 0
----------------------------------
generation 0 has 1881 finalizable objects (33e365b0->33e38314)
generation 1 has 41580 finalizable objects (33e0dc00->33e365b0)
generation 2 has 685816 finalizable objects (33b70020->33e0dc00)
Ready for finalization 0 objects (33e38314->33e38314)
      MT    Count    TotalSize Class Name
......snip......
00ce67e0   726827     49424236 Microsoft.Xna.Framework.Graphics.Texture2D*

726 000 , , . , dumpheap , 218. , , , , .

*0:038> !dumpheap -stat -type Microsoft.Xna.Framework.Graphics.Texture2D
total 0 objects
Statistics:
      MT    Count    TotalSize Class Name
00ce67e0      218        14824 Microsoft.Xna.Framework.Graphics.Texture2D
Total 218 objects*

, ? , , , OOM. 218 - Finalizer .

Andy

+5
2

, .

XNA, ReRegisterForFinalize Texture2Ds, Device.Texture []. Sunburn XNA, , , .

XNA (Texture3D ..) , , , .

XNA 5, - , SuppressFInalize , . , :-) Sunburn , , .

+2

, ? Object.Finalize:

Finalize , , GC.ReRegisterForFinalize GC.SuppressFinalize .

, , . , .

+1

All Articles