Everything you want to know about Visual Studio ALM and Farming
Brian Harry is a Microsoft Technical Fellow working as the Product Unit Manager for Team Foundation Server. Learn more about Brian.
More videos »
One of the big problems that I’ve talked about is virtual memory exhaustion and the resulting VS instability. Today, VS is a 32-bit process – I’m sure that’s going to change (become 64-bit) at some point but it won’t for 2010. A 32-bit process has 2GB of address space on a 32-bit OS. You can throw the 3GB switch and get another GB at the cost of taking a GB away from the OS – it works OK but the OS doesn’t always like it – particularly if you are running server components on your machine (like IIS). If you are on a 64-bit OS, 32-bit processes get a full 4GB of virtual address space without any penalty to the OS – handy eh?
In the end, many customers are still running on 32-bit OSes and asking them to go change boot parameters (the 3GB switch) just isn’t an appropriate thing for us to do, so we’re focusing on making sure VM works well in the 2GB of address space that many customers have available.
This can be complicated by Virtual Address space fragmentation. This is caused by smallish gaps between other virtual address space allocation. You can reach the point where there’s enough virtual address space left but there’s not enough contiguous space to satisfy allocations. So saying everything is OK as long as virtual memory allocation stays below 2GB really isn’t realistic. The app will become unstable well before that.
Further, any test we do has to take into account that users will always do some things we didn’t expect so running VM all the way up to the threshold and saying “good enough” just isn’t acceptable either.
So what do you do?
We’ve started by gathering some “real world apps”. By this I mean some of you, our customers, have actually given us copies of your large apps. We’re incredibly grateful for this because they are great tools to ensure that we are staying in touch with the kinds of apps our customers are building and how VS is working for them. Oh, and we’re using a couple of internal MS apps as well. We’ve chosen 6 of them (apps of various types: web, WPF, Sharepoint, etc) that are all large and we believe characterize a large portion of our customer base.
We then choose a set of operations – load the solution, edit some code, design some forms, debug, checkin some changes, etc, etc that represent a realistic end user interaction with each application.
And lastly, we’ve chosen a threshold or 1.5GB of VM. We will not consider it acceptable until all 6 of the scenarios are able to execute without ever going over 1.5GB of VM. We believe this will allow adequate room for users to do things we didn’t anticipate and still have a buffer before getting near the instability threshold.
Here’s a picture of where we currently stand with the 6 apps (btw, I’ve changed the names of the apps to protect the identity of people we are working with). Most of these apps were RED when we started the VM effort a couple of months ago. As you can see we’ve made some good progress but we aren’t done yet.
Let’s take a look at some detail on one of the “bad ones”. Here you can see the way we are tracking this. You can see the “steps” in the scenario, the virtual memory after each step and the comparison to VS 2008 SP1 (for all steps where there is an equivalence). You’ll see there are more bars here than steps listed, I think that’s an artifact of the slideware (not all steps are listed). We use this to look for any places where VM jumps significantly or varies substantially from VS 2008 to focus investigations.
We also plot the VM growth from different builds against each other. In this case, you can see that in the Nov 11th build (21111) the CB died halfway through the scenario because it ran out of VM and you can see that by Nov 25th (21125) we had improved it so that that not only did it complete but it is generally better than VS 2008 (let us remember that VS 2008 isn’t flawless so we don’t blindly take parity with it as success). As you can see we still have a bit of work left to do to hit out 1.5GB goal.
We also track improvements over time from build to build in more of a trend fashion:
And lastly we use a “ledger” format for tracking fine grained progress. This is the best way I’ve found to track this kind of thing: Identify the goal and current status against it. Identify the fixed currently in progress and the expected improvements (generally an informed guess) and identify the areas that are under investigation (the things that just don’t look right) and best wild ass guess you can make about how much improvement “ought” to be available based on what it is vs what you think it should be. This gives you a way to see things moving through the pipeline, understand progress towards the goal and make priority trade-offs.
Hopefully that gives you some insight into how we are thinking about the VM issue and the progress we are making.
Brian
I am interested in what changes were made that cut the memory usage of the C# WinForms solution nearly in half.
Where are you seeing that?
Are you only using these solutions to track WM usage, or do you also use them to track other aspects like editing performance etc? It would be nice to know some key figures of the projects like number of forms/classes/lines of code so that one can compare with the projects one works with.
Yes, we are using large projects to test performance as well - in many cases, the same projects, in some cases others. One we've been using a lot to test performance lately is the Expression Blend project. I'll see if I can track down some stats on the projects and share them.
I would like to see similar analysis with common add-ins enabled. For example, we use Resharper, VisualSvn, and TestDriven.NET. I suspect that CodeRush is popular in other shops. I know that it is not Microsoft's responsibility to make these add-ins work with Visual Studio, but it would be nice to see testing done against common usage scenarios.
Yeah, the same thought occured to us. Clearly we can't test everything but if you look at the comments on the first slide, you'll see that we've chosen to do some testing with Resharper, DevExpress, Infragistics and Telerik. We've found some issues with Resharper and are working with them on it. Best I can tell, they are being very receptive/responsive.
I was assuming that the C# WinForms solution started at over 1.5GB, and is now at 0.85, so that's getting close to a 50% reduction. But I just realized you said "most" of them started out red, not all, so maybe it didn't start out that high.
Got it. I think it that case, it likely started lower (I don't recall to be honest). We've saved a few hundred MB of VM, I'd say. I'll keep blogging about areas where we've saved a fair amount. I wrote another post today.
have you considered testing vs10 on WoW64 after an 'editbin /LARGEADDRESSAWARE devenv.exe' ? it would be great to know that the BVTs pass, even if it's not officially supported.
Piersh, VS2010 (and VS2008) is fully supported on x64 (running in WOW64) and has the /LARGEADDRESSAWARE flag so that it will utilize a full 4GB of VM. (Brian mentioned this above "If you are on a 64-bit OS, 32-bit processes get a full 4GB of virtual address space...")
For customers that are short on VM, x64 is the way to go. However, for now we have to assume that most of our customers will be using VS2010 on a 32 bit OS.
Daviid Berg - Performance Engineering
Or, "Putting Humpty Dumpty back together again after the horse has left the barn".
Cool post, I've forwarded it to my colleagues because we face the same issues. Thank you for blogging on the mechanics of managing the software development process, it is an incredibly valuable contribution to the software engineering literature.
An add-in that is important to us is Intel's FORTRAN compiler, for what that's worth. I wish I could send you our code base, it would make me sleep better. I also wish our customers would send us their critical workflows and datasets so we could do regression tests and performance tests against them, but I'm not getting a whole lot of traction there either.