From the course: Visual Studio: Advanced Debugging Tools

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Analyze memory usage with Diagnostics tools

Analyze memory usage with Diagnostics tools - Visual Studio Tutorial

From the course: Visual Studio: Advanced Debugging Tools

Start my 1-month free trial

Analyze memory usage with Diagnostics tools

- [Instructor] Start by debugging the application. And I've got three buttons here that will add items to a list, remove items from the list and force a garbage collection. So let's take a look at the application before running any of this code. So you can see that I've got about 40 megabytes of memory in use and I can take a snapshot at any time by clicking the snapshot button to preserve the state at that moment in time. So at 20 seconds in to the run, I have about 19,000 objects and this is my heap size. Now when I clicked on this top button I'll add some items to this list of integers, this is how many items are in the list right now, and you can see that in my process memory in the timeline there's a yellow spike here, that indicates that a garbage collection happened and you can also see that the size of my memory increased. So now I'll take another snapshot, and confirm that yes, the number of objects increased…

Contents