Monday, June 5, 2017

Dump and Analyze .Net Applications Memory: MemoScope.Net

1:41 PM Leave a Reply
Dump and Analyze .Net Applications Memory

MemoScope.Net is a tool to analyze .Net process memory: it can dump an application’s memory in a file and read it later. The dump file contains all data (objects) and threads (state, stack, call stack). MemoScope.Net will analyze the data and help you to find memory leaks and deadlocks

It’s very useful to :



debug crashed process: out of memory, dead lock, infinite loop or fatal exception
find memory leaks
It can read it and analyze it to find information about:

data: display any instance content, query all instances of a type and save data in csv file
threads: state, exception, stack trace and content, deadlocks
memory: segments, regions, clr roots, loaded modules
It can analyze :

strings
references “patterns”
delegates
arrays
root path






Install

Source Code: clone the repository from GitHub and run the solution with Visual Studio 2015 (with .Net 4.6) The solution uses Nugget so don’t forget to restaore packages before the first build.
Binaries: get a build from AppVeyor:
Debug: x86 x64
Release: x86 x64


Use cases

Out of Memory

I know, with 64 bits apps it should not be an issue but computers only have a few a few Go so it may still happen if your application :

is using too much memory (peak)
runs for days and has a “slow” memory leak


Dead lock

If your application is locked and you want to know where and why: dump the memory, display the threads status and blocking objects to see what thread is holding one that is waited by anoter thread.



Hard to reproduce bug

Sometimes, users can do weird things with your application and you can’t make it happen on your computer so ask the user to dump its application’s memory to analyze it on your machine.

Download

0 comments :