In any mixed native / managed process, there is a mixture of using native / managed memory. If there is no GC-controlled relationship between them, then this API is not needed. For example, if there are certain deterministic state changes in the managed code that cause the allocation and release of internal memory, then nothing that the GC can do will never force the memory to free.
However, very often there is a built-in memory stored in managed objects with finalizers. In this way, GC can reduce the size of the native heap, simply by launching the collection and launching these finalizers.
Therefore, if you have a lot of this, you may need to name this API (as the documentation says).
As for how much you should say this, this is probably not what you can prepare for pure analysis, especially with a third-party library. You need to run Performance Monitor, run a test that allocates many third-party objects, and look at the Native Bytes and CLR counts to see how they are related.
Since you are using a COM object, you can really determine the forced instances to clean up when you know that you no longer need them using Marshal.ReleaseComObject . Note that you need to use a dumb loop to get rid of the object:
while (Marshal.ReleaseComObject(obj) != 0) { }
Daniel Earwicker
source share