If you need to measure memory usage from code (as you mentioned in a comment) use JetBrains dotMemory Unit framework (it's free), it's designed exactly for such tasks.
var snapshot1 = dotMemoryApi.GetSnapshot();
foo.Bar(); // run your code
var allocatedSize = dotMemoryApi.GetDifference(snapshot1).GetNewObjects().SizeInBytes;
It is designed to be used with unit tests easily, but also can be used with any application. Current EAP version contains standalone launcher for that purpose.
Ask me if you need a help with that framework.
There is online doc for previous version
https://www.jetbrains.com/dotmemory/unit/help/Introduction.html