.NET Blog

Free. Cross-platform. Open source. A developer platform for building all your apps.

Catch, Rethrow and Filters – Why you should care?
Catch, Rethrow and Filters – Why you should care?
 A very common pattern in the usage of managed exception handling is that of catching an exception, inspecting it's type and rethrowing it once you realize it was not the exception you wanted to handle. Below is such an example (and should be avoided in preference to another approach described further below in the writeup) that uses ...
Understanding the Binder – Part 1
Understanding the Binder – Part 1
 This is an introductory post on the internals of CLR Binder.     What does the Binder do? CLR's Binder is a piece of code that, when given an assembly name, determines where the assembly is and binds to it. So how does the Binder locate assemblies? Let's assume that you are loading an assembly (let’s ...
CLR Inside Out
CLR Inside Out
The CLR team has a column in the MSDN magazine called 'CLR Inside Out' where we go in-depth into various aspects of the CLR. The magazine is published monthly, and you can find the list of 'CLR Inside Out' articles over here. If you have topics you'd like to see covered in the article, please let us know! This month, we have an article ...
Welcome to the CLR Team Blog!
Welcome to the CLR Team Blog!
 Hello from all of us in the Common Language Runtime (CLR) team. This year, we decided to start a blog to share and to hear from you. From the sharing perspective, we have quite a lot of things to cover - everything from best practices, tips and tricks, what we are working on and all the new features, conferences that we are attending/...
So, what’s new in the CLR 4.0 GC?
So, what’s new in the CLR 4.0 GC?
PDC 2008 happened not long ago so I get to write another “what’s new in GC” blog entry. For quite a while now I’ve been working on a new concurrent GC that replaces the existing one. And this new concurrent GC is called “background GC”. First of all let me apologize for having not written anything for so long. It’s been quite ...
64-bit vs 32-bit
64-bit vs 32-bit
As 64-bit machines become more common, the problems we need to solve also evolve. In this post I’d like to talk about what it means for the GC and the applications’ memory usage when we move from 32-bit to 64-bit.   One big limitation of 32-bit is the virtual memory address space - as a user mode process you get 2GB, and if you use ...
He’s live… he’s live not… he’s live…
He’s live… he’s live not… he’s live…
I was making some code changes today and thought this was interesting to share. As you know, the WeakReference class has a getter and a setter method to get and set the Target which is what the weakref points to. See Using GC Efficiently – Part 3 for more details on WeakReference.   Note that the code below is only for illustration ...
Difference Between Perf Data Reported by Different Tools – 4
Difference Between Perf Data Reported by Different Tools – 4
.NET CLR Memory\% Time in GC counter and !runaway on thread(s) doing GC. The 2 common ways people use to look at the time spent in GC are the % Time in GC performance counter under .NET CLR Memory, and the CPU time displayed by the !runaway debugger command in cdb/windbg. What do they mean exactly? % Time in GC is calculated like this: When ...
Difference Between Perf Data Reported by Different Tools – 3
Difference Between Perf Data Reported by Different Tools – 3
Both the !SOS.gchandles command (added in CLR 2.0) and the .NET CLR Memory\# GC Handles counter show you the number of GC handles you have in your process. The # GC Handles counter is one of the rare counters in the .NET CLR Memory category that doesn’t get updated at the end of each GC. Rather we update it in the handle table code, for ...
Difference Between Perf Data Reported by Different Tools – 2
Difference Between Perf Data Reported by Different Tools – 2
Managed Heap Size We have both .NET CLR Memory perf counters and SoS extensions that report manged heap size related data. Difference 2 There are a few .NET CLR Memory counters that are related to the managed heap size: # Total Committed Bytes # Total Reserved Bytes I explained what these counters mean here. Now, how are ...