none
Finalization Thread RRS feed

  • Question

  • We are seeing a memory leak with one of our WCF applications and I was wondering if someone could clarify something for me. Using windbg I ran !finalizequeue and it shows thousands of objects in each Heap set as "Ready for finalization". 

    Heap 0
    generation 0 has 464 finalizable objects (0000000033877190->0000000033878010)
    generation 1 has 52 finalizable objects (0000000033876ff0->0000000033877190)
    generation 2 has 19958 finalizable objects (0000000033850040->0000000033876ff0)
    Ready for finalization 228791 objects (0000000033878010->0000000033a36dc8)
    ------------------------------
    Heap 1
    generation 0 has 1508 finalizable objects (000000002ee2e168->000000002ee31088)
    generation 1 has 91 finalizable objects (000000002ee2de90->000000002ee2e168)
    generation 2 has 23498 finalizable objects (000000002ee00040->000000002ee2de90)
    Ready for finalization 249421 objects (000000002ee31088->000000002f0182f0)
    ------------------------------
    Heap 2
    generation 0 has 66 finalizable objects (00000000292660d0->00000000292662e0)
    generation 1 has 63 finalizable objects (0000000029265ed8->00000000292660d0)
    generation 2 has 19411 finalizable objects (0000000029240040->0000000029265ed8)
    Ready for finalization 238531 objects (00000000292662e0->00000000294380f8)
    ------------------------------
    Heap 3
    generation 0 has 510 finalizable objects (0000000034e470d8->0000000034e480c8)
    generation 1 has 77 finalizable objects (0000000034e46e70->0000000034e470d8)
    generation 2 has 19910 finalizable objects (0000000034e20040->0000000034e46e70)
    Ready for finalization 226933 objects (0000000034e480c8->0000000035003470)
    Statistics for all finalizable objects (including all objects ready for finalization):

    That tells me that the finalizer thread is stuck. So I ran !Threads command in windbg to get the finalizer thread id and this is what it shows....

    ThreadCount:      2969
    UnstartedThread:  0
    BackgroundThread: 187
    PendingThread:    0
    DeadThread:       2782
    Hosted Runtime:   no
                                                                                                            Lock  
           ID OSID ThreadOBJ           State GC Mode     GC Alloc Context                  Domain           Count Apt Exception
    XXXX    2 19e8 0000000001f64b10 80039220 Preemptive  0000000000000000:0000000000000000 000000000d4aacb0 0     Ukn (Finalizer) 
      18    3  cb4 000000000d9bf7a0  102a220 Preemptive  0000000000000000:0000000000000000 000000000150e940 0     MTA (Threadpool Worker) 
      19    4 1a24 000000000f762720    21220 Preemptive  0000000000000000:0000000000000000 000000000150e940 0     Ukn 
      20    6  e1c 0000000010f4eae0  3029220 Preemptive  0000000000000000:0000000000000000 000000000d4aacb0 0     MTA (Threadpool Worker) 
      22   48 1548 000000001feb1880    21220 Preemptive  0000000000000000:0000000000000000 000000000150e940 0     Ukn 
      23   49 11a4 000000001feb2050    21220 Preemptive  0000000000000000:0000000000000000 000000000150e940 0     Ukn 
      24   50  a64 000000001feb2820    21220 Preemptive  0000000000000000:0000000000000000 000000000150e940 0     Ukn 

    The first thread in the list is the finalizer thread and the thread id is XXXX. What does that mean? I'm guessing it means the thread does not exist anymore, or isn't running. Can someone confirm that or correct my understanding? 


    Dan


    • Edited by dhoenig Wednesday, February 22, 2017 10:43 PM
    Wednesday, February 22, 2017 10:35 PM

All replies

  • Hi Dan,

    Since you are meet a memory leak, do you have dump file? if yes, please post here.

    By the way, I find a Good tutorial for WinDbg. Please have a check about that command.

    Have a nice day!

    Kristin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 24, 2017 1:24 AM
  • I have the dump file and it's about 700mb zipped. How can I post it here? The only thing I see it allows are images.



    Dan

    Thursday, March 2, 2017 7:29 PM