My .net application does some heavy string loading/manipulation and unfortunately the memory consumption keeps rising and rising and when looking at it with a profiler I see alot of unreleased string instances. Now at one point of time or another I do need all objects t hat do have these string fields, but once done, I could get rid of e.g. the half of it and I Dispose() and set the instances to null, but the Garbage Collector does not to pick that up.. they remain in memory (even after half an hour after disposing etc).
Now how do I get properly rid of unneeded strings/object instances in order to release them?
They are nowhere referenced anymore (afaik) but e.g. aspose's memory profiler says their distance to the gc's root is '3'?
Update: The original strings are coming from an interop instance. Is it possible that those are causing the leaks?
As in.. assigning
myClass.StringProperty = interopInstance.Description.Text;
.. does my .StringProperty still have a reference to that interop one and therefore 'leaking'/keep the interopInstance uncollected & not properly released/unmarshaled?