dotMemory Unit is a unit testing framework which allows you to write tests that check your code for all kinds of memory issues. You can now extend NUnit, MSTest or another .NET unit testing framework with the functionality of a memory profiler.
dotMemory Unit fits any workflow: it can integrate with JetBrains Rider and Visual Studio, works with standalone unit test runners, and is Continuous Integration–ready. Last but not least, dotMemory Unit is free.
Checking for objects of a certain type is the main way to locate memory leaks in your code. With dotMemory Unit, you can specify a set of objects by almost any condition, calculate their number and size, and use this information in your assertions.
When you need to simply evaluate the amount of memory allocated in a test, you can use the AssertTraffic attribute. This flexible attribute allows you to filter traffic data by object type, interface, or namespace.
Like in the dotMemory profiler, you can use checkpoints not only for traffic amount assertions, but also for many kinds of snapshot comparisons.
Some memory issues will still require further manual investigation in dotMemory. Just set the rules when you want this done, and a workspace for further analysis in dotMemory will be created automatically.