We have an application that is running on 5 (server) nodes (16 cores, 128 GB Memory each) that loads almost 70 GB data on each machine. This application is distributed and serve
GC.Collect()
will only free memory where an object is not referenced by anything else.
A common scenario where a leak can occur is by not disconnecting an event handler from an object before setting it's reference to null.
As an exercise in avoiding leaks, it's a good idea to implement IDisposable
on objects (even tho' it's meant for releasing unmanaged objects), simply from the point of view of ensuring that all handlers are disconnected, collections are cleared correctly and any other object references are set to null.