Debugging Finalizer Thread Freezes During Ole Drag and Drop

Dear Colleagues, I have an application which causes a problem on a certain machine during an extended Ole Drag and Drop operation. There is a Gen2 GC Collection event whose start time coincides with Finalizer thread going to sleep until the mouse is released and the object is dropped. If I keep dragging for a while, I run out of memory because the Finalizer thread has been blocked. I profiled this in dotTrace in Timeline mode. I see that the last call on the Finalizer thread before it is blocked for several minutes contains only a stack trace of system dlls without any function names. Therefore I cannot tell for sure what exactly caused the Finalizer thread to be suspended for so long, whether this is related to user-code lock contention or just system/GC behavior. I researched WinDbg options which seems to have no problem showing system function calls. However, I have to be actively dragging an object with my mouse for this to occur, so breakpoints and step-by-step execution in WinDbg is not an option. By the time you stop at a breakpoint, the drag-and-drop operation is over. Is there any way for me to get the system function call details during passive debugging / profiling while I am doing drag-and-drop? Is there anything like dottrace timeline view that can show me what that deadly call is after which the Finalizer thread stops working until I releasethe mouse? Thank you
0
1 comment

Hi,

There are a few relevant questions on StackOverflow/Microsoft Q&A, have you seen them? For example - https://docs.microsoft.com/en-us/answers/questions/36047/wpf-class-with-finalizer-memory-leak.html and https://stackoverflow.com/questions/43857450/finalizer-thread-blocked-causing-memory-leak

About functions names for system DLLs: could you please try to attach to the profiled process with Visual Studio or WinDBG, download all symbols, and after that start the Timeline profiling session? In this case, if system symbols are available in the paths specified in the _NT_SYMBOL_PATH environment variable, dotTrace will show system function names in the snapshot.

This behavior is not documented because it is a part of native profiling functionality, which hasn't been released yet.

0

Please sign in to leave a comment.