ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Monitor memory with dotMemory Unit

Last modified: 11 February 2024

If you have dotUltimate license, you can profile memory usage of your application with JetBrains dotMemory. You can also check your code for all kinds of memory issues right from your unit tests using JetBrains dotMemory Unit.

When dotMemory is enabled, the Reference dotMemory Unit Framework Reference dotMemory Unit Framework command appears together with Run Unit Tests Run Unit Tests Ctrl0U,0R/Debug Unit Tests Debug Unit Tests Ctrl0U,0D commands in the editor, in the Solution Explorer, as well as on the toolbar of the Unit Test Sessions window. You can use this command to automatically install the JetBrains.DotMemoryUnit NuGet package and reference it in your unit test project.

Even without dotMemory, you can manually install the JetBrains.DotMemoryUnit NuGet package and reference it in your unit test project.

As soon as you reference the dotMemory Unit Testing Framework, ReSharper will add Run under dotMemory Unit Run under dotMemory Unit Ctrl0U,0M to other unit testing actions, so that you will be able to make your unit tests pass or fail depending on memory traffic, presence of specific objects in memory, and other factors. For more information, refer to Unit Testing and Memory Profiling: Can They Be Combined?