The one I use is Mono profiler. It has various options; the simplest usage is
mono --profile=log program.exe
And then, after program.exe
would exit, it'd leave a profiler file (output.mlpd
by default), and to read the gathered information use:
mprof-report output.mlpd
E.g. I do mprof-report output.mlpd | vim -
.
By default it collects a bunch of different informations. At the very beginning of the output (given default settings) you will see the table of functions sorted by «allocated» column, e.g. a snip:
Allocation summary
24 Bytes Count Average Type name
25 7357392 306558 24 System.IntPtr
26 6677904 139123 48 System.Collections.ArrayList.ArrayListEnumeratorSimple
27 5842736 136185 42 Mono.Unix.Native.Syscall._pollfd[]
28 3078176 49566 62 System.Byte[]
29 2574504 38057 67 System.String
30 908320 14803 61 System.Int32[]
31 719984 5294 136 Mono.Globalization.Unicode.SortKeyBuffer
Its advantages out of my mind:
- It is crossplatform, so you could easily profile .net RAM allocations on GNU/Linux and Mac either.
- It is developed by creators and largest users of .net — Microsoft. Earlier it was developed by Xamarin, but MS bought them, and now they mentioned on the main Mono page.