Determining if an Object is being referenced

  • Thread starter Thread starter Phil Jones
  • Start date Start date
P

Phil Jones

Is there a way to determine if an object is being referenced by any other
objects?

This is what the GC does to determine whether an object should be properly
destroyed. I was wondering if this functionality was available for general
use, or embedded within the GC.

Thanks everyone...
 
All managed object are allocate from managed heap, the GC will trace this
process when an object is created, so that it know if a object is
referenced. Only with a object, we can't know if it has been referenced or
not. Following are some articles on this issue, hope them be helpfull to
answer your question:

Automatic Memory Management
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconautomaticmemorymanagement.asp

Programming for Garbage Collection
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconprogrammingessentialsforgarbagecollection.asp


Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."
 
To supply, here is a good tool for visualizing and analyzing allocations on
the GC heap:

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=32543
25d-a4aa-4bb3-aa86-c72d5104ec74

Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."
 
Back
Top