Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
.NET Memory Management Part 2. Advanced topics and tools.
More on generational GC●   Problem statement    –   Older objects can reference newer ones●   Compiler generated code to k...
GCHandles●   System.Runtime.InteropServices.GCHandle●   Additional GC Roots from GCHandle table●   Kinds    –   Normal    ...
Segments●   How managed heaps work with physical    memory●   Ephemeral segment    –   Keeps Gen0 and Gen1●   Segments can...
More CLR heaps●   Loader heap    –   CLR type system    –   GC Roots from static fields    –   Size depends on assembly co...
GC Flavors●   Workstation GC. Can be:    –   Stop-the-world    –   Concurrent    –   Background (.NET 4.0)●   Server GC
Tools: Performance counters●   .NET CLR Memory    –   % Time in GC    –   Bytes in all heaps    –   Total committed bytes ...
Tools: Memory profilers●   Free    –   CLR Profiler (Microsoft)●   Paid    –   JetBrains dotTrace    –   ANTS Profiler    ...
Tools: WinDbg●   SOS●   Case study●   Links:    –   http://blogs.msdn.com/b/carloc/archive/2007/10/08/ok-n    –   http://w...
Tools: Load generators●   Apache Benchmark●   JMeter●   WCAT (Web Capacity Analysis Tool)●   Load Runner●   Report: Case s...
Upcoming SlideShare
Loading in …5
×

.NET Memory Management - Part 2. Advanced topics and tools

1,225 views

Published on

Published in: Technology
  • Be the first to comment

.NET Memory Management - Part 2. Advanced topics and tools

  1. 1. .NET Memory Management Part 2. Advanced topics and tools.
  2. 2. More on generational GC● Problem statement – Older objects can reference newer ones● Compiler generated code to keep track – Memory barrier● Card table – Internal bit table that marks dirty old object regions
  3. 3. GCHandles● System.Runtime.InteropServices.GCHandle● Additional GC Roots from GCHandle table● Kinds – Normal – Weak – WeakTrackResurrection – Pinned
  4. 4. Segments● How managed heaps work with physical memory● Ephemeral segment – Keeps Gen0 and Gen1● Segments can be returned to OS● Segments and LOH – Free memory in LOH is not swapped
  5. 5. More CLR heaps● Loader heap – CLR type system – GC Roots from static fields – Size depends on assembly count● JIT heap – JIT-ted code is stored here
  6. 6. GC Flavors● Workstation GC. Can be: – Stop-the-world – Concurrent – Background (.NET 4.0)● Server GC
  7. 7. Tools: Performance counters● .NET CLR Memory – % Time in GC – Bytes in all heaps – Total committed bytes – Heap size counters ● Gen0 – #GenX Collections ● 10x rule● .NET CLR Loading – Bytes in loader heap● Case study● http://msdn.microsoft.com/en-us/library/x2tyfybc.aspx
  8. 8. Tools: Memory profilers● Free – CLR Profiler (Microsoft)● Paid – JetBrains dotTrace – ANTS Profiler – YourKit profiler
  9. 9. Tools: WinDbg● SOS● Case study● Links: – http://blogs.msdn.com/b/carloc/archive/2007/10/08/ok-n – http://windbg.info/doc/1-common-cmds.html – http://geekswithblogs.net/.NETonMyMind/archive/2006/0 – http://msdn.microsoft.com/en-us/library/bb190764.aspx
  10. 10. Tools: Load generators● Apache Benchmark● JMeter● WCAT (Web Capacity Analysis Tool)● Load Runner● Report: Case study

×