Common story: I develop an ArcMap extension using C#. Most problems can be solved by using all kinds of geoprocessing tools from ArcToolbox. What is generally more advisable:
- Creating a new geoprocessor object for each tool?
- Re-using one single geoprocessor object?
When 1) is recommended, do I have to release the com object after a single tool has been executed? Whats about calling GC.Collect()?
When 2) is recommended, is it a good method to instantiate it once and reuse it over and over again, for example using the singleton pattern?
My personal experience is that using the second method, I run into serious memory access violations while debugging my code.