-
Hi, I'm investigating a GCHandle leak in an application and I'm having trouble finding documentation in this area. I believe I narrowed the source down through dotnet-trace and perfview to WeakReferences being created causing a SetGCHandle event without any corresponding DestroyGCHandle events, but someone else pointed out that it's not clear if WeakReferences would cause DestroyGCHandle events if they were garbage collected in gen 0. I found these methods: runtime/src/coreclr/vm/gchandleutilities.h Lines 285 to 298 in b83fee9 and some of them don't have any references, such as DestroyWeakHandle. Does that mean the DestroyGCHandle event won't be created? I'm not too familiar with the inner workings of the .NET garbage collector, so any help or guidance would be huge for me 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
weakrefs should emit a DestroyHandle event when their finalizer is run in |
Beta Was this translation helpful? Give feedback.
weakrefs should emit a DestroyHandle event when their finalizer is run in
GCToEEInterface::EagerFinalized
. this will callDestroyTypedHandle
.