Web Debug

Fix broken web applications, from servers to clients.

GC (Garbage Collection) related

Do you know GC(Garbage Collection)? Here is a list of questions with answers. You can check whether you can answer them.

.NET Garbage Collector PopQuiz - Followup
By Tess Ferrandez

1. How many GC threads do we have in a .NET process running the Server version of the GC on a dual-core machine?
2. What GC mode is used in the web development server (cassini) on a quad proc machine? Why? (you can choose from server, workstation or concurrent-workstation)
3. How many finalizer threads do we have in a .NET process running the Server version of the GC on a quad proc machine?
4. When is an object garbage collected?
5. What causes an object to move from Generation 0 to Generation 1 or to Generation 2?
6. If you look at the GC sizes for Generation 0, 1 and 2 in perfmon, why is most of the memory in the process in Gen 2?

How does the GC work and what are the sizes of the different generations?
By Tess Ferrandez

What are segments and heaps? How much is allocated for the GC?
What are generations and why do we use a generational GC?
When and how does a collection occur?
What are roots? What keeps an object alive?
What is the Large Object Heap? And why does it exist?
Which GC Flavor fits my application best?
What is the cost of a garbage collection? How can I keep this cost at a minimum?
Additional Resources


If you want to know more. Here are the in-depth articles related with CLR memory management from MSDN Magazine

Investigating Memory Issues
By Claudio Caldato and Maoni Stephens

Tools of the Trade
GC Performance Counters
Windows Performance Counters
Verifying an OOM Exception in a Managed Process
Determining What Caused an OOM Exception
Measure Managed Heap Size
What If Objects Survive?
Is Fragmentation a Problem on Your Managed Heap?
Measuring Time Spent on Garbage Collection
Investigating High CPU Usage

Large Object Heap Uncovered
By Maoni Stephens

The Large Object Heap and the GC
When a Large Object Gets Collected
LOH Performance Implications
Collecting Performance Data for the LOH
Using a Debugger

Digging into IDisposable
By Shawn Farkas

Disposable Objects
The Disposable Pattern
Managed vs. Native Resources
Managed Resource Cleanup
Deriving from a Disposable Type
Dispose and Security

Fork me on GitHub