A Messy Transition: Practical Problems With 32bit Addressing In Windows
by Ryan Smith on July 12, 2007 12:00 PM EST- Posted in
- Software
Except in a few cases where 64-bit code is clearly faster, the primary purpose for Vista x64's existence is to resolve the problems of 32-bit addressing space, and we're just not at the point yet where even most enthusiasts are pushing that limit. Once applications begin to push the 2GB addressing space limitation of Win32 (something we expect to hit very soon with games) or total systems need more than 4GB of RAM, then Vista x64 in its current incarnation would be a good choice.
For some time now we have been mentioning the potential problems that are likely to result from the switchover from 32bit(x86) Windows to 64bit(x64) Windows. Due to a multitude of issues, including Windows' memory management, the basic design of the PC architecture, and consumer support issues, there is no easy path for mass migration from 32bit Windows to 64bit Windows. As a result we have been expecting problems as consumers begin to make the messy transition.
We published the above mentioned guide on February 1st, expecting the fall/winter 2007 games to be the ones to push the 2GB addressing space limitation of Windows, and it turns out we were wrong. It turns out that two weeks after we published the above article, THQ published Supreme Commander, a RTS with a massive appetite for resources. It can be simultaneously GPU limited and CPU limited, which is why it's a standard benchmark here for our performance articles, it's also memory limited in more than one way: it's hitting the 2GB barrier of 32bit Windows.
An artifact of the design of 32bit processors and the 32bit API for Windows, the 2GB barrier is a cap on how much addressing space (related to but not equivalent to memory usage) a single application can use. This isn't a bug but rather the result of how hardware and software was created so many years ago, and while everyone has known this barrier will inevitably be hit, as we'll see there are several reasons why it can't simply be moved or bypassed. Meanwhile hitting it involves affected applications crashing for what can appear to be no good reason, and understanding why the 2GB barrier exists and what can be done will be important for resolving those crashes.
On a personal note, I am a semi-casual player of real time strategy(RTS) games and I've been playing Supreme Commander lately. This is a different kind of article, it's a record and the result of my own efforts to resolve why I was having crashing issues with Supreme Commander. With no intended disrespect towards THQ or the game's developers (Gas Powered Games) we could have not possibly asked for a better example of the 2GB barrier in action. It's exactly the experience we believe many people will have as they hit the 2GB barrier, mainly those power users who use large monolithic applications such as games or multimedia tools. This is an article on what the problem with the 2GB barrier is, what kind of experiences a user may expect when hitting it, and what can be done to fix it.
But before we get too far ahead of ourselves, let's discuss memory management in Windows. Understanding the problem with Supreme Commander requires understanding what the 2GB barrier is, why it's there, and what makes it so problematic.
69 Comments
View All Comments
instant - Saturday, July 21, 2007 - link
Could the writer please detail what, exactly, is wrong with XP-64bit edition?Having run it since it was released and never had a problem with it, I would be interested in knowing what problems I should have experienced.
BUL - Tuesday, July 17, 2007 - link
A few things I've found about /3GB in XP...1) In terms of "consumer" OS's, XP Pro is the only one to support it. (XP Home and W2K Pro DO NOT!) Vista has a different method, outlined in the article.
2) If you change boot.ini, make sure you add a "3GB" boot option to your operating systems, not just change the one entry to /3GB. If a new driver gets installed that doesn't like /3GB, you could be left without the ability to change boot.ini back. (I can't find any info on whether /3GB affects Safe Mode, however safe mode may run in "3GB" mode!) So, unless you have the ability to WRITE to NTFS partitions outside of Windows, you may be stuck if you don't. See http://www.gehrytechnologies.com/catia/catia/catia...">http://www.gehrytechnologies.com/catia/catia/catia... for how to do it...
Now, personally, I feel that a limitation like memory shows the "men from the boys" in terms of programmers. Windows and "endless memory" has allowed for bloatware for far too long and allowed for sloppy, inefficient programming... Just think back how many games & other programs could run on an XT with 640KB of RAM because the programmers wrote highly efficient code. (Lotus 1-2-3 for DOS was written primarily in assembler; Quattro Pro could open even larger spreadsheets than 1-2-3 because it utilized pseudo-virtual memory).
Now we've come full-circle into the world of Windows, and some of these programs now have to become more efficient. That's what programmers are paid to do...
Anorax - Monday, July 16, 2007 - link
On some of the larger maps in AW2 the game will occasional crash to desktop and leave an error window saying it has exceeded the 2GB memory space. Not that helpful but at least it tells you why it crashed.the Chase - Sunday, July 15, 2007 - link
Thank you so much for this article. I had a post awhile back in the forums asking for help on why in Vista I couldn't even run PR for bf2 unless I turned down the texture setting to Medium.Never figured it out though people here did offer some good ideas for fixes. After reading this article I knew this is what was going on. I searched on the Net and found out how to use Visual Studio C++ to modify the Bf2 executable. Problem solved! (I have the 64 bit version of Vista).
And to think I was ready(thinkeng about anyway) going to buy another 2 GB's of memory to try and cure the problem. Thanks again.
P.S. I also did the same fix for XP pro 64 and now PR runs much smoother than before in that OS also.
spookware - Friday, July 13, 2007 - link
Just wanted to mention that the description of how windows uses memory is correct for XP and previous versions but it is not quite how windows vista works.Specifically, vista does not automatically take the upper 2GB of adress space for the kernel any more. It instead grows the kernel adress space downard on demand. Allthough the associated switches (/3G) have the same prupose in vista what they are setting is actually the upper maximum for the kernel adress space.
Magumi - Friday, July 13, 2007 - link
I guess this means that if I want to buy a computer to last me at least three or four years, I need to get 64bit Vista and 8GB of RAM and hope that drivers and incompatibilities get resolved soon.Greyhead - Friday, July 13, 2007 - link
Ryan, great article. Some other posters mentioned the use of the /PAE on servers. I recently discovered that MS recommends NOT using the /3GB switch in conjunction with /PAE. I followed their advice on a large SQL server we have and saw immediate positive results. The problem with /PAE /3GB combination is that when the OS is limited to 1 GB, there is not enough room for the size of the heap needed to support the /PAE option! This can be viewed using performance monitor - selecting "memory" options and then viewing total PTEs available (Page Table Entries). There are MS articles that describe the minimum PTEs needed, and before I changed our server it was way under the minimum. We had stupid errors on the server - blue screens, "not enough memory" errors when transferring files to another machine. Once the change was made, these problems disappeared. 2003 server has a more tunable /3GB switch using the /USERVA switch. There are technet articles which provide guidance on it's usage.Keep up the great work -
-bill
redpriest_ - Friday, July 13, 2007 - link
binary is illegal.Kougar - Friday, July 13, 2007 - link
The moment I saw the title I was thinking of Supreme Commander. I particularly enjoy the insanely huge 8-player games, but it only took about 40 minutes before these would crash... oddly enough they did not always crash either in some situations, making the crashing appear random and only confusing my attempts to troubleshoot this game. It would have been quite appreciated that this issue would have at least been mentioned in the game's readme file, if nothing else.Having (very luckily) stumbled across MadBorris's thread I made the modifications to XP and SC has been running since. I have not run into any instability or issues with XP configured with the /3gb switch for what it is worth. Am I wrong in that users with video cards featuring smaller onboard memory sizes will have an "advantage" with this problem? There is a large difference between a 320mb GTS and 740MB GTX, or heaven forbid a 1GB HD 2900 card? And while on the subject does a dual-GPU configuration (and therefore dual VGA memory) make things even worse?
Ryan Smith - Friday, July 13, 2007 - link
Yes to the first question. To the second question I believe that's also a yes, but I don't have a system configured to test that theory.