It's automatic and what you've done should not be done . The problem is that there was either no memory pressure or you're not releasing the memory as you are thinking.
/ p>
I do not know the method that you used to check, 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 to decompile what was not being used, which is something innocuous and there is even a tiny loss in doing so.
The GC acts when it is needed, it knows how to do it very well. In some rare applications it is necessary to control this in a more specific way and it is not an easy task. But at least it is safe unlike unmanaged languages that in addition to being extra difficult, runs risks. The GC only acts when an heap allocation is requested and does not have space in one of the generations.
I can assure you that there was a lot of collection that you did not even notice. You would have to monitor the GC to see the collections that occurred.
You have a API for this .
List of events it generates .
CLR Profiler .
Process Explorer .