I am using Monoprofile . It has various options; simplest use
mono --profile=log program.exe
And then, after exiting program.exe , it will leave the profiler file ( output.mlpd by default) and read the collected information:
mprof-report output.mlpd
eg. I am doing mprof-report output.mlpd | vim - mprof-report output.mlpd | vim - .
By default, it collects a bunch of different information. At the very beginning of the output (with the given default settings) you will see a table of functions sorted by the column "selected", for example. 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 are out of my mind:
- It is cross-platform, so you can easily profile .net RAM allocations on GNU / Linux and Mac.
- It was developed by the creators and largest users of .net - Microsoft. It was previously developed by Xamarin, but MS bought them, and now they mentioned Mono on the main page.
Hi-angel
source share