Visual Studio 2017 Community Edition
I am trying to understand/use the Performance Profiler's Memory Usage in what I feel must be a memory leak in my application (MVVM with custom controls). Three snapshots were taken:
I then compared snapshot #3 to snapshot #1. In the resulting table, I imposed a filter of "NewProgressNoteView". The below is the results of expanding the instance of the top Doctor_Desk.Views.NewProgressNoteView. Of note is '[Cycle Detected]' which feels suspicious, but I do not know what it means exactly or how to use this information to fix the memory leak(s)? What do I do next?
Any help would be most appreciated.
TIA.
What Is [Cycle Detected] when viewing managed memory?
When viewing Heap snapshots inside Visual Studios Diagnostic tools you have:
The Object Type Window which shows objects held in memory.
When you select a particular Object Type, you can access:
Both these tabs are reference views which help you trace an objects parent and child references presented via an expanding-tree menu.
Cycle Detected simply means that the memory analyzer has found the parent or child reference directly or indirectly references back to your selected object. So rather than display a circular tree-view trace it adds a cycle detected tag.
This isn't neccessarily a bad thing or your root issue.
For further reading about analyzing memory and an expanded explanation of reference views check out this msdn article: https://learn.microsoft.com/en-us/visualstudio/profiling/analyze-memory-usage?view=vs-2019