I have few questions how Garbage collector works in C# applications
Application performs heavy I/O operations and database operations over the course of 10 days.
I read at places where some experts advise not to use GC since it is Framework's responsibility and let it do its job or if you force it, application's performance will be slow down.
I somehow need to use 32bit APIs where memory is limited to 2GB and leaving other resources, our application in this discussion could be crashed if it starts showing up at 1.5GB.
For managed resources, I am able to easily get back the memory that is used after every iteration in loop. But when it comes to COM components that I use for geoprocessing, it is very inconsistent how memory gets released. I take good care of releasing all sorts of COM objects after using them in a given iteration still I end up of getting error such as 'not enough memory'. So after about 300 to 400 iterations[each iteration takes some amount of time close to few mins], I only need to close and reopen to release all the resources.
I will provide more inputs if someone wants to listen more.
The main issuethat I am looking to resolve is, how to get all my memory back consistently after each iteration let us say in for loop by cleaning up everything especially with COM objects.
Best Regards