|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reference count?I'm wondering if a tool exists that will integrate with the VS 2005
debugger, such that when I set a breakpoint I can inspect a reference and see how many other references exist to that object. I'm sure there is an internal reference count somewhere but have no idea how to inspect it. Not feasible in any garbage collected system. Note I didn't say not
possible. Its simply that the overhead to do this would be so sever that the system performance would noticibly suffer. In VB 6 and COM, the system increments a counter in the object header every time a reference is added to the object. Then the counter is decremented whenever a reference is removed. When this counter reaches zero, the object is removed, decrementing references in any objects it points to. In .NET the system keeps track of memory roots. These are classically the program stack and data segment. In .NET, there are additional roots such as a stack and data segment for each thread in a program as well as other roots that are maintained by the garbage collector itself. When the GC runs, it starts with each root and sets a flag that uniquley identifies this GC run. Any objects that aren't identified on this run are eligible for removal from memory. After the mark pass, memory is compacted by the GC so that available memory is consolidated at the end of the heap. Microsoft has a rather extensive technet article on the .NET garbage collector, but this is the fundamental description of all modern garbage collection systems. Thus, there is no way to track the number of references to an object. All the system needs is one reference and it stops looking. Mike Ober. Show quoteHide quote "Fred Hedges" <dontlike@spammuch.com> wrote in message news:e3cm1b$cti$1$8302bc10@news.demon.co.uk... > I'm wondering if a tool exists that will integrate with the VS 2005 > debugger, such that when I set a breakpoint I can inspect a reference and > see how many other references exist to that object. I'm sure there is an > internal reference count somewhere but have no idea how to inspect it. > > > > >
User permission problems. sqlconnection
Ho do I create a program that can get recognized as a printer driver and installed with the add prin On the fly formatting of textbox contents How can I embedd graphics in Outlook Email without using MAPI Register DLL for COM interop and use it in ASP Strip chars from a string VB script to VB.Net back to VB script CALL a dialog form just after the main form is loaded. how to read a tiff file in vb.net read a tiff file in vb.net |
|||||||||||||||||||||||