Memory View – Exploring .NET Memory While Debugging with Rider 2018.1
During the past few weeks, the Rider 2018.1 EAP builds came with a number of new debugger features, and today’s build is no different. Rider 2018.1 EAP adds another improvement: a Memory View that lets us explore the managed heap while debugging, allowing us to look into the memory space that is used by our application!
When the debugger hits a breakpoint, we can open the memory view in a separate tab. After clicking the grid, Rider shows us the total number of objects in the heap grouped by their full type name, the number of objects, and bytes consumed.
The memory view keeps track of the difference in object count between breakpoints. For example, after loading a large amount of data from a JSON file, we can see the number of
System.String instances went up dramatically. This gives us an idea of the memory traffic going on in our application, which could potentially influence performance.
Note the default behavior is that we have to click the view between each breakpoint to update the information. From the toolbar, we can choose to automatically update our view, or choose to only show objects with a non-zero diff.
From the memory view, we can search for specific types. For example, we can search for
Beer instances, and then double-click (or Enter) to open the list of instances, where we can inspect details of the instance or copy its value.
We don’t have to use the memory view to navigate to instances. While debugging, we can use Alt+Enter and show instances of the current type.
The memory view works with the full .NET Framework (4.5+) as well as .NET Core. Mono is not supported.
One last note: while the memory view can greatly help us to explore the effect of our code on our application’s memory space, this is not a full-blown profiler. We recommend using dotTrace and dotMemory to investigate performance and memory for .NET applications.
Give the latest Rider 2018.1 EAP build a try! We’d love to hear your feedback!
Subscribe to Blog updates
Thanks, we've got you!
Another Look into the Future with Rider’s Predictive Debugger
In the 2023.2 release cycle, we’ve introduced the Predictive Debugger in ReSharper, which gives you predictions about code paths and variables beyond the current execution pointer. We’ve written extensively about its advantages compared to alternative debugging strategies like thorough thinking, log…
Visualize Entity Framework Relationships and Additional Query Analysis in ReSharper 2023.3
A lot of teams are using Entity Framework or EF Core to work with their database. As an Object-Relational Mapper (ORM), it bridges objects in code to a relational database model, so that as a developer you don’t have to worry too much about the actual database. We all know: that’s not entirely tr…
Automatically Analyze ASP.NET Core Performance With Dynamic Program Analysis
Slow web pages may make your users or customers abandon your web application, even before they’ve had a proper look at it. You’ve likely also been frustrated working with a web application that is slow to load. The good news is that the latest versions of ReSharper and JetBrains Rider’s Dynamic P…
OSS Power-Ups: MassTransit – Webinar Recording
The recording of our webinar, OSS Power-Ups: MassTransit, with Chris Patterson, is available. This was the thirteenth episode of our OSS Power-Ups series, where we put a spotlight on open-source .NET projects. Subscribe to our community newsletter to receive notifications about future webinars.…