Page Comparison - Improving App Performance with Timeline Profiling. Memory Traffic (v.37 vs v.38)

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is well known that memory traffic impacts heavily on application performance: The higher the traffic, the slower your app. The problem is not in how frequently your app allocates memory (that is almost free as far as performance goes), but in how your app collects memory that's no longer needed. The convenience of the garbage collection (GC) mechanism that does this, unfortunately, has its cost.


In this tutorial, we will learn how to use timeline profiling to detect excessive GCs and their causes.


Sample App
Step 1. Running the Profiler and Getting a Snapshot
Step 2. Starting Analysis
Step 3a. Where Does Memory Traffic Come From? Analyzing Garbage Collections
Step 3b. Where Does Memory Traffic Come From? Analyzing Memory Allocations
Step 4. Improving the Code
Step 5. Verifying the Fix

Sample App
Sample App
Sample App


  1. Rebuild the solution and perform profiling one more time as described in Step 1.
  2. After the snapshot is open in Timeline Viewer, switch Analysis Subject to Memory Allocation.
  3. Look at the Threads diagram. Our improvement works! Memory traffic was reduced from 6 GB to 164 MB in FileProc.

    If you zoom into the time interval where FileProc processed files, you’ll see that file processing has sped up significantly. Now, it takes only 370 ms to process all files, compared to 3445 ms before the fix.