Does the .NET garbage collector perform predictive analysis of code?
The Garbage Collector relies on information compiled into your assembly provided by the JIT compiler that tells it what code address ranges various variables and “things” are still in use over. As such, in your code, since you no longer use the object variables GC is free to collect them. WeakReference will not prevent this, … Read more