what does HANDLE(RefCnt) mean in windbg?

The following is my checking gcroot of the object 0330e9a8. I found Its root is a hanle with its type is "RefCnt".

How could I get the actual reference count of it. And How could I know WHICH object obtained its reference?

0:042> !GCRoot 0330e9a8 Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. Scan Thread 5 OSTHread 534 Scan Thread 8 OSTHread 60c Scan Thread 9 OSTHread 1120 Scan Thread 10 OSTHread 1b30 Scan Thread 11 OSTHread 52c Scan Thread 12 OSTHread 1da8 Scan Thread 15 OSTHread 1cbc Scan Thread 19 OSTHread 1808 Scan Thread 22 OSTHread 1b6c Scan Thread 23 OSTHread 1e70 Scan Thread 0 OSTHread 1a34 Scan Thread 32 OSTHread 1840 DOMAIN(001C1050):HANDLE(RefCnt):d31460:Root:0330edf8(xxxxxxx)-> 0330eedc(xxxxxxxxxxxx)-> 0330e9a8(xxxxxxxxxxxxxx)

-------------Problems Reply------------

It's a GC handle that keeps .NET objects reachable for unmanaged code.
for example: subscribing to COM object event.

What types of roots would you normally see when running !gcroot and what do they mean?
ESP: ESP=Extended Stack Pointer, Object is in use on a stack
Strong: Strong reference, Typically a static variable
WeakLn: Weak Long Handle, A weak reference that is tracked through finalization (can be resurrected)
WeakSh: Weak Short Handle, A weak reference, can't be resurrected
Pinned: Pinned object, pinned at a specific address, can't move around during garbage collection.
RefCnt: Reference count, referenced as long as the reference count is > 0.

See: .NET Debugging Demos Lab 7: Memory Leak - Review

Category:clr Views:2 Time:2011-07-13
Tags: clr windbg sos

Related post

  • .NET RegEx "Memory Leak" investigation 2010-04-29

    I recently looked into some .NET "memory leaks" (i.e. unexpected, lingering GC rooted objects) in a WinForms app. After loading and then closing a huge report, the memory usage did not drop as expected even after a couple of gen2 collections. Assumin

  • GC does not collect object that implements interface from interop assembly, no roots 2011-11-01

    After a few minutes of work the managed memory contains a lot of unreferenced objects of the type that was created by implemeting interface from interop assembly. GC.Collect does not remove objects from memory. It looks that .NET creates COM callable

  • How do I find the handle owner from a hang dump using windbg? 2009-01-22

    How do I find out which thread is the owner of my Event handle in windbg: I'm running !handle 00003aec f and get Handle 00003aec Type Event Attributes 0 GrantedAccess 0x1f0003: Delete,ReadControl,WriteDac,WriteOwner,Synch QueryState,ModifyState Handl

  • Windbg: SOS.dll: !gcroot: DOMAIN(xxx):HANDLE(Pinned):Does it really mean object is pinned? 2009-08-05

    The documentation on the SOS.dll Windbg extension seems sparse. After issuing a !gcroot <address>, I am getting something containing the following: DOMAIN(XXX):HANDLE(Pinned):XXX:Root:XXX(System.Object[])-> Does "HANDLE(Pinned)" really mean

  • How to find the event handler for a DispatcherTimer in windbg 2010-09-02

    I have a Silverlight 3 application which seems to be leaking DispatcherTimer objects. At least, over time when the application runs I find more of them on the heap: !dumpheap -type DispatcherTimer returns an increating number of them. I'd like to fin

  • Windbg command to get all gdi handle count from a crash dump 2009-10-26

    I have a crash dump and I suspect GDI leaks to be a cause of the crash From the full crash dump is there anyway to find out the number of GDI handles used by my process when it crashed? regards G --------------Solutions------------- It is unlikely si

  • WinDbg outputs characters to console nonstop 2008-10-03

    I'm developing a POS application that is used in about 200 locations as of right now using .Net 2.0, WCF and SyncFusion components for the GUI. Two days ago we installed the application in a new location, and it has been suffering sudden termination

  • Detect file handle leaks with Win32 C++ 2008-11-24

    Is there some way to detect file handle leaks at program termination? In particular I would like to make sure that all of my handles that get created are being freed in code. For example, I may have a CreateFile() somewhere, and at program terminatio

  • A strange problem with C++ exception handler 2008-11-26

    I used standard exception handling methods in C++. Which is try{} and catch{} block. In my code, func1() would throw an exception, And func2 is like this: bool func2() { try{ func1(); } catch(myException& e) { cerr << "error!" << endl

  • What is the best resource for learning the features and benefits of windbg? 2008-12-14

    What is the best resource for learning the features and benefits of windbg? I want to be able to discuss investigate memory issues (handles, objects), performance issues, etc . . . --------------Solutions------------- These are some I like: Maoni Ste

  • Display content of shared memory section in WinDbg? 2008-12-24

    I've got a couple of programs that communicate using a named memory section. Is there any way that I can view the contents of this shared memory section from WinDBG, either in user mode or kernel mode? I don't have a pointer to it, but I do know the

  • C++: Error handling problem across threads 2009-01-19

    In general I use exceptions to deal with errors, however the problem I have here is that the error applies to a different thread than the one that caused it. Basicly the window has its own thread, and the direct3d device must be created and reset by

  • windbg and visual studio express editions 2009-01-28

    Does anyone know if windbg can be used together with Visual C# 2008 Express Edition Ta! --------------Solutions------------- windbg isn't really an IDE debugger; it is more commonly used directly on compiled exes on the machine. As such, yes, it shou

  • How can you break on handle creation? 2009-03-16

    I have an application that spawns multiple child processes. Before launching a child, I create stdOut and stdErr handles to a log file (for example, if I am about to launch procA, i create handles to logA.log). I set these handles on the child proces

  • How to use WinDbg to analyze the crash dump for VC++ application? 2009-04-09

    How do I use WinDbg for analyzing a dump file? --------------Solutions------------- Here are some general steps that will get you on your way: First, you must change your compiler's settings so that it creates PDB files, even for release builds. Late

  • Determine path to registry key from HKEY handle in C++ 2009-06-01

    Given a handle to a Windows Registry Key, such as the ones that are set by ::RegOpenKeyEx(), is it possible to determine the full path to that key? I realize that in a simple application all you have to do is look up 5 or 10 lines and read... but in

  • How to get return value from a function in windbg? 2009-06-22

    I am trying to debug some win32API's like Createthread which returns a handle. How to get the return values in windbg? I did some research and found that return values generally stored in EAx register. If I put breakpoint on CreateThread then I can s

  • bsod every time a handle to a driver is created 2009-07-09

    im writing a driver and I have a problem everytime I try to open a handle to my driver using CreateFile, I get bsod (Access Violation) It's important to mention that my driver loads successfuly and I dont get any errors does someone knows how to hand

  • windbg/cdb hangs when bp hit 2009-07-23

    I have a problem where cdb or windbg hangs frequently, but not all the time, when I'm debugging with it and I attach to a specific application on my machine. I found this article: http://www.nynaeve.net/?p=164 which talks about a symbol loading race

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.153 (s). 11 q(s)