Is there a known (documented) set of .NET types that allocate memory in the unmanaged portion of the process' memory?
For example, Microsoft documents that the WPF infrastructure allocated unmanaged memory for its retained rendering model in order to optimize performance. Are there other such portions of the .NET framework that utilize large amounts of unmanaged memory?
If it implements IDisposable
there is a very good chance it owns unmanaged data, or it's owning a managed class that ultimately owns unmanaged data. If it has Finalize()
, it's sign that it directly owns unmanaged data.
As a rule of thumb, if it implements IDisposable
, then Dispose()
it as soon as you're done.
As far as I know, there is no single document that describes or identifies which classes in the framework use unmanaged resources. The MSDN documentation for the specific class may, but that would require you to look at specific classes.
Overall, it's a safe bet that many of the classes make use of some unmanaged code at some point. For instance, many of the Windows Forms controls are simply wrappers around the Win32 controls so they make use of unmanaged resources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With