• Save
Analyzing .Net Application Memory Usage And Issues
Upcoming SlideShare
Loading in...5
×
 

Analyzing .Net Application Memory Usage And Issues

on

  • 5,163 views

Throughout my development career I've made use of great tools for analyzing memory usage in my applications. The .NET environment is no exception and the available tools are excellent....

Throughout my development career I've made use of great tools for analyzing memory usage in my applications. The .NET environment is no exception and the available tools are excellent.

This presentation discussed and demonstrated using 2 commercial and 1 free tool for profiling the memory usage of a .NET application or web site.

Statistics

Views

Total Views
5,163
Views on SlideShare
5,150
Embed Views
13

Actions

Likes
1
Downloads
0
Comments
0

2 Embeds 13

http://www.slideshare.net 10
http://www.cwi-websoft.com 3

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Analyzing .Net Application Memory Usage And Issues Analyzing .Net Application Memory Usage And Issues Presentation Transcript

  • Analyzing .NET Application Memory Usage and Issues Using Free and Commercial Profiling Tools Presented by Greg Sohl © 2006, Gregory M. Sohl
  • Memory Issues? Huh?
    • .NET has Garbage Collection. I don’t have to worry about memory anymore!
    • Users have lots of memory now. I don’t have to worry about using lots of memory anymore!
    • Windows has virtual memory space. I don’t have to worry about using lots of memory anymore!
  • Common .NET Memory Issues
    • Too much allocation
    • Memory allocations are long lived
    • Managed memory leaks – reference leaks
    • Work “with” the Garbage Collector. It’s your friend - but only if you are nice to it.
  • Why Use a Profiling Tool?
    • To understand how your allocations correspond with the assumptions made by the GC
    • Track unintentional references to instances (leaks)
    • Track references that are being held too long
  • 3 Allocation Profilers
    • .NET Memory Profiler – SciTech
      • Commercial – best of breed
    • Ants Profiler – Red Gate
      • Commercial – Useful, but light weight feature set
    • CLR Profiler 2.0 – Microsoft
      • Free – Powerful, but challenging to use
    • Others listed in resources
  • Definitions
    • Root – The base object holding references to other objects
      • Examples: A static field, a local variable or a method parameter.
    • Root Path - The path of referees from the selected instance to a root
    • Garbage Collection – The process by which objects with no root (unreachable objects) are cleaned up from the heap.
  • Sample - Conway’s Game of Life
    • A simulation of cellular automation.
    • http://en.wikipedia.org/wiki/Conway's_Game_of_Life
    Pulsar Pattern
  • Demo - .NET Memory Profiler
    • Cream of the crop profilers
    • Can attach to running processes
    • Show native memory usage
    • Great real-time view
    • Copy grids to clipboard
    • Low impact mode
  • Demo - CLR Profiler 2.0
    • For the MacGyver in you.
    • A robust tool, without all the modern conveniences.
  • Demo - Ants Profiler
    • Good tool with basic features
    • Memory analysis a recent addition to execution analysis
    • No real-time or IDisposble analysis
    • Best thread support
  • Resources
    • .NET Memory Profiler
      • http://memprofiler.com/
    • Ants Profiler
      • http://www.red-gate.com
    • CLR Profiler 2.0
      • http://www.microsoft.com/downloads/details.aspx?familyid=A362781C-3870-43BE-8926-862B40AA0CD0&displaylang=en
      • Or http://tinyurl.com/ozsgr
  • Resources
    • DevPartner Studio Professional
      • Includes a memory profiler
      • http://www.compuware.com/products/devpartner/studio.htm
  • Resources
    • Introduction to the CLR Profiler
      • http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20050217CLRPS/manifest.xml
    • Profiling Managed Code with the CLR Profiler
      • http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20030729clrgn/manifest.xml
    • How To: Use CLR Profiler
      • http://msdn2.microsoft.com/en-us/library/ms979205.aspx
    • CLR Profiler (v1.1)
      • http://www.microsoft.com/downloads/details.aspx?familyid=86ce6052-d7f4-4aeb-9b7a-94635beebdda&displaylang=en
  • Resources
    • Improving Managed Code Performance (P&P)
      • http://msdn2.microsoft.com/en-us/library/ms998547.aspx
    • Code Review: .NET Application Performance
      • http://msdn2.microsoft.com/en-us/library/ms998574.aspx
    • Checklist: Managed Code Performance
      • http://msdn2.microsoft.com/en-us/library/ms979052.aspx
    • Improving .NET Application Performance and Scalability (full Patterns and Practices book)
      • http://msdn2.microsoft.com/en-us/library/ms998530.aspx
  • Resources
    • Rico Mariani's Performance Tidbits (Blog)
      • http://blogs.msdn.com/ricom/default.aspx
    • Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework (Jeffery Richter)
      • http://msdn.microsoft.com/msdnmag/issues/1100/gci/
    • Garbage Collector Basics and Performance Hints (Rico Mariani)
      • http://msdn2.microsoft.com/en-us/library/ms973837.aspx
  • Thank You!
    • Questions?