gcUnmanagedToManaged MDA
Note
This article is specific to .NET Framework. It doesn't apply to newer implementations of .NET, including .NET 6 and later versions.
The gcUnmanagedToManaged
managed debugging assistant (MDA) causes a garbage collection whenever a thread transitions from unmanaged to managed code.
Symptoms
An application running unmanaged user components using COM and platform invoke is causing a nondeterministic access violation in the CLR.
Cause
If an application is running unmanaged user components, then those components might have corrupted the garbage-collected heap. This causes an access violation in the CLR when the garbage collector tries to walk the object graph.
Resolution
Enabling this assistant reduces the time between when the unmanaged component corrupts the garbage-collected heap and when the access violation happens by forcing a garbage collection to occur before every managed transition.
Effect on the Runtime
Causes a garbage collection whenever a thread transitions from unmanaged to managed code.
Output
This MDA produces no output.
Configuration
<mdaConfig>
<assistants>
<gcUnmanagedToManaged/>
</assistants>
</mdaConfig>
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho