Generational GC in Windows Phone Mango

 

This is an announcement only post, do subscribe to this blog feed or on to https://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 on for some time. The next version of the Windows Phone will have a Generational Garbage Collector (GenGC for short). A bunch of folks has worked real hard to get this piece into WP7 in a short time.

Today on Windows Phone 7 we have a stop the world, mark-sweep-compact, non-generational GC. When it runs it pauses the entire execution, looks through each object in the application to find and eliminate all unused data. This manifests as longer app startup time and stutters during time critical execution.

In Mango we are adding Generational GC to reduce collection latency to address both of these problems . Existing apps and games even without any changes can expect faster startup, faster level loads and reduction in gameplay stutters due to collection. Developers can specifically optimize for the new generational GC to completely remove stutters during animations and game play that came due to these GC pauses.

As an example see how one of the existing games butterfly benefits from the GenGC. One of the phone below is running the GenGC and the other is not and it should be obvious which one is based on which starts up first (do note that both in Keynote and here we are showing startup gains because it’s easier to show that. In gameplay stutters is hard to show on lower resolution videos). Also note that not just at the core startup at every level it gets a bit faster.

Direct link https://www.youtube.com/watch?v=FtusaSuFIpc

Please refer to my previous blog https://blogs.msdn.com/b/abhinaba/archive/2009/03/02/back-to-basics-generational-garbage-collection.aspx on what is a generational GC and how it helps.

The new GenGC uses 2 generations and write barriers to track Gen1 to Gen0 references. This post is just to announce the feature. I will be making a series of posts to get into the gory details as we get closer to handing over the bits to our developers. I am sure the developers would want to know the sizes of the various generations, when full vs generational collections happen and so much more. Do register to my blog feed or my twitter account https://twitter.com/abhinaba  for the announcements as I publish these posts.

Comments

  • Anonymous
    April 17, 2011
    Very nice! I'm looking forward to your detailed posts.

  • Anonymous
    April 20, 2011
    It would be very, very nice to have the same GC on the xbox and phone, not just for performance reasons, but so we can use the same algorithms, optimized for a generational GC.