Steps to perform memory analysis:
PerfView is very usefull tool to from Microsoft to analyze, memory and performance issues. In this section we will see how to use PerfView tool to perform memory leak analysis.
1. Collect the full memory dump file for the exe to be investigated.
Use Task manager->Select the process -> Right click Create Dump File. to save the dump. Else use ProcDump.exe with "-ma" option (Available in SysInternals website) to create full memory dump.
2. Open the dump file using PerfView.exe
3. "Dump GC Heap" button shall walk through the heap and start dumping them into .GCHeap File.
4. If we are debugging Live process then ForceGC, Freeze would options make sense. Anyway now we are checking already collected dump file.
5. Double click on "GCHeap" dump file to view the stack table.
6. Stack table contains various Filter options.
7. Options like Inc, IncCount shall help you to find which object occupies the heap. most of the Array or String used to be on Top of all the memory allocated.
8. We could use options like Fold, Drill Into, F10 to see who is really referring this objects.
9. As soon as we know the major reference holding live objects, we should be able to find the root cause.
10. Apart from great table view, PerfView also provide Diff option if we collected the heap snap shots on difference time interval of the same process to find the leaking objects and the root holding the objects.
No comments:
Post a Comment