I know the answer (it's 42)

A blog on coding, .NET, .NET Compact Framework and life in general....

Browse by Tags

Tagged Content List
  • Blog Post: Test Driven Development of a Generational Garbage Collection

    These days everyone is talking about being agile and test driven development (TDD). I wanted to share a success story of TDD that we employed for developing Generational Garbage Collector (GC) for Windows Phone Mango. The .NET runtime on Windows Phone 7 shipped with a mark-sweep-compact ; stop the world...
  • Blog Post: WP7 Mango: The new Generational GC

    In my previous post “ Mark-Sweep collection and how does a Generational GC help ” I discussed how a generational Garbage Collector (GC) works and how it helps in reducing collection latencies which show up as long load times (startup as well as other load situations like game level load) and gameplay...
  • Blog Post: WP7 Mango: Mark-Sweep collection and how does a Generational GC help

    About a month back we announced that in the next release of Windows Phone 7 (codenamed Mango) we will ship a new garbage collector in the CLR. This garbage collector (GC) is a generational garbage collector. This post is a “ back to basics ” post where I’ll try to examine how a mark-sweep GC works and...
  • Blog Post: Generational GC in Windows Phone Mango

      This is an announcement only post, do subscribe to this blog feed or on to http://twitter.com/abhinaba as I’d be making more detailed posts on how we are building the Generational GC and what developers need to know. Today in the MIX11 keynote ScottGu just announced something that I’ve been working...
  • Blog Post: WP7: When does GC Consider a Local Variable as Garbage

      Consider the following code that I received: static void Foo() { TestClass t = new TestClass(); List<object>l = new List<object>(); l.Add(t); // Last use of l and t WeakReference w = new WeakReference(t); GC.Collect(); GC.WaitForPendingFinalizers(); Console.WriteLine...
  • Blog Post: Windows Phone 7 App Development: When does the GC run

    If you are looking for information on the new Generational GC on Windows Phone Mango please visit http://blogs.msdn.com/b/abhinaba/archive/2011/06/14/wp7-mango-the-new-generational-gc.aspx Many moons ago I made a post on When does the .NET Compact Framework Garbage Collector run . Given that a lot...
  • Blog Post: Back to Basics: Memory leaks in managed systems

    Someone contacted me over my blog about his managed application where the working set goes on increasing and ultimately leads to out of memory. In the email at one point he states that he is using .NET and hence there should surely be no leaks . I have also talked with other folks in the past where they...
  • Blog Post: NETCF: Count your bytes correctly

    I got a stress related issue reported in which the code tried allocating a 5MB array and do some processing on it but that failed with OOM (Out of Memory). It also stated that there was way more than 5 MB available on the device and surely it’s some bug in the Execution Engine. Here’s the code. try{...
  • Blog Post: NETCF: GC and thread blocking

    One of our customers asked us a bunch of questions on the NETCF garbage collector that qualifies as FAQ and hence I thought I’d put them up here. Question: What is the priority of the GC thread Answer: Unlike some variants of the desktop GC and other virtual machines (e.g. JScript) we do not have any...
  • Blog Post: How does the .NET Compact Memory allocator work

    As I mentioned in one of my previous posts the .NET Compact Framework uses 5 separate heaps of which one is dedicated for managed data and is called the managed heap. The .NETCF allocator, allocates pools of data from this managed heap and then sub-allocates managed objects from this pool. This is...
  • Blog Post: 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 removing the event sink from the event invoker...
  • Blog Post: 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 to run in any specific order The thread on which...
  • Blog Post: .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 to the following reasons It is targeted towards...
  • Blog Post: 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 mc = new MyClass(); GC.ReRegisterForFinalize...
  • Blog Post: 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. ”. The description lead him to believe it is the total...
  • Blog Post: How many heaps does the .NET Compact framework use

    While discussing the memory architecture with an internal customer, he inquired about how many heaps .NETCF creates. I’m not sure how it might be helpful to users, but the answer is 5. This has been touched upon in some blogs and presentations (e.g. MEDC 2005) but I thought I’d put up a handy list. Heap...
  • Blog Post: 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 heap simply because it is primarily targeted towards...
  • Blog Post: .NET Compact framework GC Quantum

    In my post When does the .NET Compact Framework Garbage Collector run I mentioned that one of the causes for starting a garbage collection is that 1 MB of data has been allocated from the last garbage collection. Essentially we keep a counter which is reset to 0 on each GC and it is incremented each...
  • Blog Post: 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 counting, mark-sweep and even coping collectors...
  • Blog Post: 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 is marked and swept. One of the primary optimization...
  • Blog Post: 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(); ObjectCollection roots = GetRoots(); for(int...
  • Blog Post: 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. How does it still get used?” The advantages...
  • Blog Post: 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. I’ll not be going into the gory details because this...
  • Blog Post: 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 an object in the object oriented sense but is...
  • Blog Post: 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 memory block (or object) from other blocks. Each time...
Page 1 of 2 (28 items) 12