It is automatic and What you did should not be done. The problem is that actually either there was no pressure from memory or you is not releasing memory as you think you are.
I don’t know the method you used to verify, but the fact that it indicates that there is memory compromised with the application does not mean that it is being used, and what happened was uncompromising what was not being used, what is something innocuous and even there is a tiny loss in doing this.
The GC acts when it’s needed, he knows how to do it very well. In some rare applications it is necessary to control this more specifically and it is not an easy task. But at least it’s safe, unlike unmanaged languages that are not only extremely difficult, but also at risk. GC only acts when an allocation is requested in the heap and has no place in one of the generations.
I can assure you that there was a lot of collection that you didn’t even notice. I would have to monitor the GC to see the collections that took place.
Has a API for this.
List of events it generates.
CLR Profiler.
Process Explorer.