You can not know. The GC does not know either, until it runs. Rooting
information is not tracked during program execution.

What do you try to achieve?

Thomas Tomiczek
THONA Software & Consulting Ltd.
(Microsoft MVP C#/.NET) 

> 
> -----Original Message-----
> From: Moderated discussion of advanced .NET topics. 
> [mailto:[EMAIL PROTECTED] On Behalf Of Pinto, Ed
> Sent: Freitag, 8. August 2003 01:30
> To: [EMAIL PROTECTED]
> 
> I've got a cache that needs to know that a weakreference's 
> target is rooted.
> What is the best way to do this?
> 
> The cache is accessed ~20 times/second in a server 
> environment, and once per minute in a rich client environment.
> 
> Calling GC.Collect would solve my logical problem, but I 
> can't imagine that it would be very performant on the server.
> 
> Are there other options I can use?  Would the profiler APIs help?
> 
> TIA,
> 
> Ed
> 
> 

Reply via email to