Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » C# / .NET / Coding   (RSS)

Memory leak via event handlers

One of our customers recently had some interesting out-of-memory issues which I thought I’d share. The short version The basic problem was that they had event sinks and sources. The event sinks were disposed correctly. However, in the dispose they missed

Finalizers and Thread local storage

Writing finalizers is generally tricky. In the msdn documentation for finalizers the following limitations are mentioned. The exact time when the finalizer executes during garbage collection is undefined The finalizers of two objects are not guaranteed

.NET Code Pitching

The word pitch can have many meanings, but in case of the code pitching it is used in the sense of “to throw away”. The desktop CLR never throws away or pitches native code that it JITs. However, the .NET Compact Framework CLR supports code pitching due

Multiple calls to GC.ReRegisterForFinalize

What happens when there are multiple calls to GC.ReRegisterForFinalize for the same object? Consider the following C# code class MyClass { ~MyClass() { Console.WriteLine("~MyClass"); } } class Program { static void Main(string[] args) { MyClass

Object Resurrection using GC.ReRegisterForFinalize

I have been thinking about writing this post for some time, but Easter weekend provided the right context to do so. When I first encountered GC.ReRegisterForFinalize I was a bit baffled. The context help “ Requests that the system call the finalizer for
Posted by abhinaba | 2 Comments

Floating point operations in .NET Compact Framework on WinCE+ARM

There has been a some confusion on how .NETCF handles floating point operations. The major reason for this confusion is due to the fact that the answer differs across the platforms NETCF supports (e.g. S60/Xbox/Zune/WinCE). I made a post on this topic

NETCF: Total Bytes in Use After GC – Perf counter

At least one of our customers were a bit confused with the .NET Compact Framework performance counter “Total Bytes in Use After GC” which is described as “ The number of bytes of memory, native and managed, in use after the last garbage collection. ”.

Dangers of large object heap

Andrew Hunter has an interesting post on the issues with large object heap on the desktop CLR. Visit http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/ Side Note: .NET Compact Framework doesn’t support large object

Back To Basics: How does the GC find object references

This post is Part 9 in the series of posts on Garbage Collection (GC). Please see the index here. Most garbage collection algorithms needs to know all other objects referenced by a given object to correctly traverse object hierarchy. All of reference

Back To Basics: Generational Garbage Collection

This post is Part 8 in the series of posts on Garbage Collection (GC). Please see the index here. One of the primary disadvantage discussed in the post on mark-sweep garbage collection is that it introduces very large system pauses when the entire heap

Back To Basics: Handling overflow in mark stage

This post is Part 7 in the series of posts on Garbage Collection (GC). Please see the index here. Let’s first recap the basic algorithm of the mark-sweep garbage collection . In C like pseudo code the algorithm looks like void GC() { HaltAllThreads();

Back to Basics: Optimizing reference counting garbage collection

This post is Part 6 in the series of posts on Garbage Collection (GC). Please see the index here. One of the comments on my previous post on reference counting GC prompted this post. The comment goes as “Ref counting GC seems to have some hard issues.

Back To Basics: Copying Garbage Collection

This post is Part 5 in the series of posts on Garbage Collection (GC). Please see the index here. In my previous post I have discussed reference counting and mark-sweep garbage collector in some detail. This post is a quick intro into the copying GC.

Back To Basics: Mark and Sweep Garbage Collection

This post is Part 4 in the series of posts on Garbage Collection (GC). Please see the index here. Recap of definition I’ll quickly repeat couple of definitions which are used in this post Object : This is a unit of storage on the heap. It generally means

Back To Basics: Reference Counting Garbage Collection

This is Part 3 in a series of post on GC, visit the list here . Reference counting (refcounting) GC is one of the two primary GC mechanisms widely used. The basic workings of this GC is pretty simple and based on counting the number of reference to a
More Posts Next page »
 
Page view tracker