Original Link: https://www.anandtech.com/show/2297



As we saw in part 1 of this series, large applications and games under Windows are getting incredibly close to hitting the 2GB barrier, the amount of virtual address space a traditional Win32 (32-bit) application can access. Once applications begin to hit these barriers, many of them will start acting up and/or crashing in unpredictable ways which makes resolving the problem even harder. Developers can work around these issues, but none of these except for building less resource intensive games or switching to 64-bit will properly solve the problem without creating other serious issues.

Furthermore, as we saw in part 2, games are consuming greater amounts of address space under Windows Vista than Windows XP. This makes Vista less suitable for use with games when at the same time it will be the version of Windows that will see the computing industry through the transition to 64-bit operating systems becoming the new standard. Microsoft knew about the problem, but up until now we were unable to get further details on what was going on and why. As of today that has changed.

Microsoft has published knowledge base article 940105 on the matter, and with it has finalized a patch to reduce the high virtual address space usage of games under Vista. From this and our own developer sources, we can piece together the problem that was causing the high virtual address space issues under Vista.

As it turns out, our initial guess about the issue being related to memory allocations being limited to the 2GB of user space for security reasons was wrong, the issue is simpler than that. One of the features of the Windows Vista Display Driver Model (WDDM) is that video memory is no longer a limited-sharing resource that applications will often take complete sovereign control of; instead the WDDM offers virtualization of video memory so that all applications can use what they think is video memory without needing to actually care about what else is using it - in effect removing much of the work of video memory management from the application. From both a developer's and user's perspective this is great as it makes game/application development easier and multiple 3D accelerated applications get along better, but it came with a cost.

All of that virtualization requires address space to work with; Vista uses an application's 2GB user allocation of virtual address space for this purpose, scaling the amount of address space consumed by the WDDM with the amount of video memory actually used. This feature is ahead of its time however as games and applications written to the DirectX 9 and earlier standards didn't have the WDDM to take care of their memory management, so applications did it themselves. This required the application to also allocate some virtual address space to its management tasks, which is fine under XP.

However under Vista this results in the application and the WDDM effectively playing a game of chicken: both are consuming virtual address space out of the same 2GB pool and neither is aware of the other doing the exact same thing. Amusingly, given a big enough card (such as a 1GB Radeon X2900XT), it's theoretically possible to consume all 2GB of virtual address space under Vista with just the WDDM and the application each trying to manage the video memory, which would leave no further virtual address space for anything else the application needs to do. In practice, both the virtual address space allocations for the WDDM and the application video memory manager attempt to grow as needed, and ultimately crash the application as each starts passing 500MB+ of allocated virtual address space.

This obviously needed to be fixed, and for a multitude of reasons (such as Vista & XP application compatibility) such a fix needed to be handled by the operating system. That fix is KB940105, which is a change to how the WDDM handles its video memory management. Now the WDDM will not default to using its full memory management capabilities, and more importantly it will not be consuming virtual address space unless specifically told to by the application. This will significantly reduce the virtual address space usage of an application when video memory is the culprit, but at best it will only bring Vista down to the kind of virtual address space usage of XP.



Testing the KB940105 Hotfix

Unfortunately the fix is not all roses at this time. Microsoft classifies this as a hotfix which may still be undergoing further testing, which means they aren't recommending that most users install this fix, nor are they even making the fix easy to get. Microsoft's official recommendation is that users not severely affected wait until the fix is delivered as part of a service pack, which would mean that it will not be normally distributed until Vista SP1 in late 2007 or early 2008, and it certainly won't be part of the next "Patch Tuesday".

Right now the only official way to acquire the hotfix is to directly call Microsoft and ask them for the hotfix, which they will supply for free. On August 23rd, Microsoft will publish the fix on the KB article page for anyone who wants to download it ahead SP1's release. For those not wanting to wait until the 23rd, we have seen the hotfix for download on various websites; however, we'd advise an extra level of caution if downloading the hotfix from an unofficial site due to the popularity of fake Microsoft patches loaded with Trojan horses.

The patch is officially supported by Microsoft, so we do not believe there are any serious problems with it, and in our testing we did not encounter any issues. We have however heard from one source that this fix is dependent on some changes that also need to happen at the video driver level. We can't substantiate this, but all the same we would recommend not installing this patch without first installing the most recent drivers for your video card.

To get an idea of how much the hotfix can reduce virtual address space usage, and if this comes with any kind of performance tradeoff, we once again ran our battery of games that have extreme virtual address space usage against Vista with and without the hotfix, and against XP as a baseline.

Software Test Bed
Processor Intel Core 2 Quad QX6850
(3.00GHz/1333MHz)
RAM G.Skill DDR2-800 (2x2GB)
Motherboard Gigabyte GA-P35-DR3R (Intel P35)
System Platform Drivers Intel 8.1.1.1012
Hard Drive Maxtor MaXLine Pro 500GB SATA
Video Cards 1 x GeForce 8800GTX
Video Drivers NV ForceWare 163.11
Power Supply OCZ GameXStream 700W
Desktop Resolution 1600x1200
Operating Systems Windows Vista Ultimate 32-Bit
Windows XP SP2
.

We'll start with Company of Heroes mission 6, which as we saw in part 2 had the biggest difference in virtual address space usage of all the games in comparing Vista and XP.

Whereas Company of Heroes would surpass the 2GB barrier under Vista just loading this mission without the hotfix, the game is safely under the 2GB barrier with the hotfix applied. Under Vista the game is still using an additional 160MB of virtual address space compared to XP, but this is far better than the gap being the entire size of the video memory on our 8800GTX prior to the hotfix.

Both STALKER and Supreme Commander show similar, albeit not as great improvements, shaving off 420MB and 260MB respectively. This shows that not all games benefit from the hotfix to the exact same degree, although from our limited sample we can extrapolate that every game should be reduced to near its optimal situation, as Vista is consistently using around 160-200MB more virtual address space than XP with the hotfix installed.

However, we also need to ask: Does the hotfix incur any performance penalty compared to not using the hotfix?

Overall Vista Game Performance
Company of Heroes
S.T.A.LK.E.R
Supreme Commander
Vista
110.2fps
58.1fps
4:15
Vista(Hotfix)
110.2fps
58.1fps
4:15
.

With performance numbers literally the same with and without the hotfix, we can safely say that there is not a performance penalty for using this hotfix.



Final Thoughts

Having seen the results of the hotfix, we can unequivocally say that anyone doing serious gaming under Windows Vista should install the hotfix (and the latest drivers for their video card) at the first chance they get. It's not a solution to the 2GB barrier, but it is a solution to Vista's extreme virtual address space usage. For gamers who are or may be experiencing crashes related to the 2GB barrier, and who are weary of the fixes we outlined in part 1, this is the best solution to resolving the problem for now.

We'd like to pause on "for now" though, as in spite of our enthusiasm for this hotfix we can't ignore the fact that this is a fix to take care of what we feel was a stupid problem in Vista long-overdue for a solution, but that's it. This hotfix won't resolve the 2GB barrier; at best it buys some more time for the 32-bit (x86) version of Vista, and at worse it's no better for applications that don't make heavy use of video memory. The 2GB barrier is still the imposing problem this series is all about, and dealing with it won't be any easier, but with this hotfix at least status quo is (nearly) maintained a bit longer.

As for what can be done to deal with the forthcoming messy transition, our views are still those that we started with at the beginning of this series. There are many interim solutions, but the only real solution is moving to 64-bit operating systems with 64-bit applications. Due to the overhead involved with such a transition we fear that this process may get a late start and won't be complete for a few years, while in the meantime users will still be dealing with the kind of crashing and odd behavior that results from hitting the 2GB barrier. Making the best of this messy transition will require some work from everyone from developers to users, if everyone is willing to put in the effort and deal with the problems.

It's worth noting that Microsoft's own solution for the issue is the same as ours, although slightly more forceful and we suspect slightly more profit-motivated (Windows XP users will have to pay to upgrade to Vista x64):

The long-term solution to this virtual address space problem is 64-bit hardware, which has significantly more address space. Windows Vista X64 provides 8 TB (8,096 GB) of user-mode virtual address space to native 64-bit applications. This is large enough to allow growth on both video memory configurations and application memory usage for many years.

Independent software vendors (ISVs) are strongly encouraged to port their games to native 64-bit applications. All graphics independent hardware vendors (IHVs) already make WDDM drivers available for 64-bit platforms at the same time as x86. Microsoft provides several tools that enable ISVs and IHVs to port their applications and drivers to the 64-bit platform. The Windows Logo Program requires that all third-part device drivers that are logo'd for Windows Vista comply with the 64-bit requirements.

Log in

Don't have an account? Sign up now