How would I make garbage collection clean up RCW objects bound to an out-proc COM server?
问题 I have a 64-bit .NET process that runs for days. The process consumes a native 32-bit COM server using DCOM. Once in a while the COM server runs out of memory because the .NET process garbage collector only sees the RCWs of the COM objects and those are quite lightweight and "not worth collecting". I need to somehow make garbage collector aware of those COM objects. For the record, I tried to run the same code periodically force-starting garbage collection and the problem goes away so the