Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » GC   (RSS)

New In Orcas Part 3: GC Latency Modes

As you may know, there are different GC modes to choose from depending on the type of application you’re using: Server GC, Workstation GC, and Concurrent GC ( more info ). These settings are process-wide, set at the beginning of the process. Once the
Posted by clyon | 7 Comments
Filed under: ,

New In Orcas Part 2: GC Collection Modes

In Orcas we’ve added an overload to System.GC.Collect(): void System.GC.Collect(int generation, System.GCCollectionMode mode) Where generation is the highest generation to collect (from 0 to System.GC.MaxGeneration) and mode can be: Default: the same
Posted by clyon | 5 Comments
Filed under: ,

New In Orcas Part 1: What we’ve been doing

The Orcas March CTP is out, and what does that mean for the Garbage Collector? The GC team has been concentrating on three areas for this release: Bug fixes. For Orcas, we’ve fixed several premature Out of Memory bugs, improved stability in certain stressful
Posted by clyon | 1 Comments
Filed under: ,

When GC.KeepAlive Doesn’t

The purpose of GC.KeepAlive(Object) is to tell the GC not to collect an object until a certain point. For example: class MyObject { ~MyObject() { Console.WriteLine(“MyObject Finalized”); } public static void Main() { MyObject obj = new MyObject(); LongRunningMethod();
Posted by clyon | 6 Comments
Filed under:

Object Resurrection

I’m sure many of you have heard the term “object resurrection” with respect to the GC. It’s an interesting (but not very useful) way to illustrate object lifetimes and the role of finalization versus garbage collection. Basically, it’s a way to reference
Posted by clyon | 3 Comments
Filed under:

How To Tell Which GC Mode Your Application Is Using

I posted previously about how to set the GC mode your application. So now that you’re running your app, how do you know it’s running in that GC mode? If you’re using v1.0 or v1.1, the CLR loads a different dll based on which GC mode (mscorwks.dll for
Posted by clyon | 8 Comments
Filed under: ,

To Null or Not to Null

GC Myth: setting an object's reference to null will force the GC to collect it right away. GC Truth: setting an object's reference to null will sometimes allow the GC to collect it sooner. As much as you may want to, you can't guarantee the GC will collect
Posted by clyon | 13 Comments
Filed under:

Part 2 in Maoni's Using GC Efficiently

Maoni posted Part 2 to Using the GC Efficiently. A very in-depth article about Server, Workstation and Concurrent GC. Check it out.
Posted by clyon | 0 Comments
Filed under:

GCHandles, Boxing and Heap Corruption

A GCHandle is a struct used to hold onto a managed object to be used by unmanaged code. With a GCHandle you can (among other things): Prevent an object from being garbage collected if unmanaged code has the only live reference to it Pin an object in memory,
Posted by clyon | 9 Comments
Filed under: ,

A Few Good GC Links

I keep a GC folder in my Favorites full of links to articles and blog posts about the .NET GC. I thought it would be a good idea to consolidate them all into one blog post, for handy reference. These are the articles I most often post as answers to questions
Posted by clyon | 7 Comments
Filed under:

Server GC Misconceptions

One of the most common “bugs” I read about on the Microsoft public newsgoups is the fact that the runtime does not automatically choose Server GC mode on a multi-proc machine, or server OS. If the server OS is running on a single-proc machine then the
Posted by clyon | 7 Comments
Filed under: ,

Server, Workstation and Concurrent GC

One common question I see asked is the differences between server and workstation GC, and how Concurrent GC fits in. Server GC is only available on multi-proc machines. It creates one GC heap (and thus one GC thread) for each processor, which are collected
Posted by clyon | 28 Comments
Filed under: ,
 
Page view tracker