Ask Dan: What's with the 3Gb memory barrier?
You can install at least 4Gb of memory on most motherboards today, but apparently you shouldn't install more than 3Gb if you're not running a 64-bit operating system. (来源：英语博客 http://space.englishcn.com)
Can't a 32-bit version of Windows (or Linux, or whatever) address 4,294,967,296 bytes (two to the power of 32) of memory, by definition?
When I open Task Manager and click the Performance tab, I see the memory limit is way more than 4Gb. I understand that includes the swap file, but if Windows can handle 8Gb or whatever of total memory including swap, why can't it handle 4Gb of physical RAM?
The executive summary: Yes, a plain PC running a 32-bit operating system - and if you're wondering if that includes your PC, then it almost definitely does - shouldn't have more than 3Gb of RAM (as I mentioned in passing in this Ask Dan), if you don't want to waste quite a lot of the last gigabyte.
If you install 4Gb, there is no way to make all of the RAM between 3Gb and 4Gb available without installing a 64-bit OS, which you can't do unless you have a 64-bit CPU. And even then it won't necessarily work.
So, to avoid hassles on current systems, it's best to stick with 3Gb or less.
(Note that the precipitate drop in RAM prices, particularly DDR2 memory, means that you might as well buy 4Gb for a DDR2 PC these days; the price difference is likely to be trivial, even if you buy a pair of 2Gb modules. Just don't expect most of the fourth gigabyte to be accessible.)
Fortunately, this isn't a big problem for most people, provided they know about it in advance. Three gigs is enough for even quite serious applications, and it's easy to install on most motherboards (two 1Gb modules, two 512Mb ones). And very nearly all of that three gigabytes will actually be seen by the system.
(The reason why not quite all of even three gigabytes is usable is related to the 4Gb problem, as we'll see.)
If you want to push the envelope, many new PCs these days are able to run a 64-bit operating system. 64-bit processors used to be weird server-class stuff, but ordinary desktop processors from the AMD Athlon 64 and Intel Core 2 onward (and even late model P4s) can run in 64-bit mode.
You have to get a separate version of Windows XP if you want the 64-bit edition, and it probably won't help much with memory limits anyway, as I'll explain in due course. But all of the retail versions of Windows Vista come with both 32 and 64-bit installers.
(Well, OK, except for the horribly crippled "Starter" edition of Vista, which isn't sold in most countries. And you probably don't actually get the 64-bit install disc, but instead have to send away to Microsoft and pay for shipping to have the thing you've already bought sent to you.)
Most PC users, though, are still using 32-bit versions of Windows (or Linux, or whatever). Then, you'll have the same "3Gb barrier" problems no matter what processor you have.
To understand why this is, you've got to go back. Way back. Back to the horrible old days of DOS and the 640 kilobyte barrier.
Back when PC users only had sixteen-bit operating systems, everybody was wrestling with the memory below the first megabyte line. That was partly because memory was expensive enough that installing whole megabytes of it was a grandiose fantasy, but it was mainly because of limitations that grew out of the cut-price IBM 8086 CPU's mere 20 memory address lines.
Two to the power of 20 bytes is one lousy megabyte. And that was the grand total memory address space available to the original PC.
A 1Mb memory limit was no big deal at the time, since only very rich people could possibly afford that much RAM, and you couldn't install more than 640 kilobytes in an early PC anyway.
The combination of the 640k maximum system memory and the one megabyte address limit, though, led to a design decision to use the memory addresses between 640 kilobytes and 1Mb as an input/output dumping ground for other hardware in the computer.
Your old PC's graphics adapter, for instance, had memory on it in which it held the data for whatever was on the screen at the time, and the computer's CPU needed to be able to read and write that memory. So each flavour of graphics adapter was assigned a portion of the 640-to-1024-kilobyte "Upper Memory Area" space as its own, and reads and writes to those addresses did stuff to the graphics adapter's memory. This process is called "memory mapped input/output", or MMIO.
This trick was all very well with computers like the original IBM PC, but when people started making PCs that could have more than 640 kilobytes of system memory, that system memory grew up into the addresses reserved for various other hardware. Now new workarounds had to be found if you wanted to find that last few kilobytes to run productivity software or games, and it all became very traumatising and hideous.
I apologise to any readers who have now remembered things that cause them to rock back and forth and mumble.