I'm investigating a possible memory leak which is causing an "Error creating window handle" Win32Exception in my .NET 2.0 WinForms app. This is related to number of Handles and numb开发者_开发问答er of USER objects (most likely) so I'm trying to log these metrics the next time the exception is thrown.
HandleCount is easy to find: Process.HandleCount
.
Does anyone know how to find the Number of USER objects? (Value can be seen in a column of the Task Manager->Processes) .NET or win API functions will do.
Thanks!
Try GetGuiResources which you can call using P/Invoke
You can also see this in Windows Task Manager. 1. Select "Process" tab. 2. Select View > "Select Columns..." and check "User Objects"
精彩评论