I\'ve create a c# application which uses up 150mb of memory (private bytes), mainly due to a big dictionary:
Dictionary Txns = new Diction
Ok, I have a theory here... Dictionary is a collection of KeyValuePair which is again a reference type.
Your dictionary contains these keyValuePairs. When you say:
Txns = null
It frees the reference 'Txns' from those KeyValuePair collection. But still the actual memory of 150 Mb is being referenced by those KeyValuePair and they are in scope, thus not ready for garbage collection.
But when you use the following:
Txns.Clear();
Txns = null;
GC.Collect();
Here, the clear method also frees the 150Mb of data from their respective KeyValuePair object references. Thus those objects were ready for garbage collection.
Its just a wild guess I am making here. Comments are welcome :)