c# - How is unmanaged memory allocated in system when instances are created? -


how unmanaged memory allocated in system when com objects or other unmanaged instances created c#?

the clr creates runtime callable wrapper (rcw) com objects want instantiate. kind of interop proxy .net com system. com object create therefore allocated , reference created in clr, puts on heap.

you must implement idisposable in class holds references rcws, because not automatically cleaned (the wrappers on .net heap, com objects not). calling dispose() on wrapper releases com objects. not implementing idisposable therefore causes memory leaks.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -