What happened to my 4GB of RAM?Q: My system says the maximum is 4GB, so I've installed
it BUT not all 4GB are showing up in Windows. Is there something
wrong with the memory or my machine? Here is a
good semi-technical article summing up the basics of what's
going on behind the scenes, which should help give you a clear idea
of the situation. Dude, Where's My 4 Gigabytes of RAM?Due to fallout from a recent computer catastrophe at work, I had the opportunity to salvage 2 GB of memory. I installed the memory in my work box, which brings it up to 4 gigabytes of RAM-- 4,096 megabytes in total. But that's not what I saw in System Information:
Only 3,454 megabytes. Dude, where's my 4 gigabytes of RAM? The screenshot itself provides a fairly obvious hint why this is happening: 32-bit Operating System. In any 32-bit operating system, the virtual address space is limited, by definition, to the size of a 32-bit value:
232
= 4,294,967,296
4,294,967,296 / (1,024 x 1,024) = 4,096 As far as 32-bit Vista is concerned, the world ends at 4,096 megabytes. That's it. That's all there is. No más. Addressing more than 4 GB of memory is possible in a 32-bit operating system, but it takes nasty hardware hacks like 36-bit PAE extensions in the CPU, together with nasty software hacks like the AWE API. Unless the application is specifically coded to be take advantage of these hacks, it's confined to 4 GB. Well, actually, it's stuck with even less-- 2 GB or 3 GB of virtual address space, at least on Windows. OK, so we're limited to 4,096 megabytes of virtual address space on a 32-bit operating system. Could be worse.* We could be back in 16-bit land, where the world ended at 64 kilobytes. Brr. I'm getting the shakes just thinking about segments, and pointers of the near and far variety. Let us never speak of this again. But back to our mystery. Where, exactly, did the other 642 megabytes of my memory go? Raymond Chen provides this clue:
Ian Griffiths offers a more detailed explanation:
And if you think devices can't possibly need that much memory-mapped IO, I have some sobering news for you: by this summer, you'll be able to buy video cards with 1 GB of video memory. To be perfectly clear, this isn't a Windows problem-- it's an x86 hardware problem. The memory hole is quite literally invisible to the CPU, no matter what 32-bit operating system you choose. The following diagram from Intel illustrates just where the memory hole is:
The proper solution to this whole conundrum is to use a 64-bit operating system. However, even with a 64-bit OS, you'll still be at the mercy of your motherboard's chipset and BIOS; make sure your motherboard supports using 4 GB or more of memory, as outlined in this MSKB article. 264
= 18,446,744,073,709,551,616
18,446,744,073,709,551,616 / (1,024 x 1,024) / 8 = 2 exabytes In case you're wondering, the progression is giga, tera, peta, exa. Although the performance benefits of 64-bit are somewhat dubious on the desktop, a 64-bit OS absolutely essential if you run applications that need to use more than 2 GB of memory. It's not common, but we're getting there. The memory hole for IO still exists in the 64-bit world, but most modern BIOSes allow you to banish the IO memory hole (pdf) to some (for now) ridiculously high limit when you're running a 64-bit OS. Don't get too excited, though. The user-mode virtual address space in 64-bit Windows is a mere 8 terabytes. Suffice it to say that we won't be running out of physical or virtual address space on 64-bit operating systems for the forseeable future. It's the final solution, at least for the lifetime of everyone reading this blog post today. Here's one parting bit of advice: if, like me, you're planning to stick with a 32-bit operating system for the next few years, don't waste your money on 4 GB of RAM. You won't be able to use it all. Buy 3 GB instead. Every motherboard I'm aware of will happily accept 2 x 1 GB and 2 x 512 MB DIMMs. * Could be raining. Posted by Jeff Atwood 144 blog reactions
Read more comments at CODING HORROR programming and human factors by Jeff Atwood -- Content (c) 2007 Jeff Atwood. You can also check this Microsoft support article (© 2007 Microsoft Corporation.) talking about this in regards to Windows Vista:SYMPTOMS Note You can access the System Information dialog box in the following
ways:• Click Start, type System in the Search box, and then click
System under Programs. CAUSE Various devices in a typical computer require memory-mapped access. This is known as memory-mapped I/O (MMIO). For the MMIO space to be available to 32-bit operating systems, the MMIO space must reside within the first 4 GB of address space. For example, if you have a video card that has 256 MB of onboard memory, that memory must be mapped within the first 4 GB of address space. If 4 GB of system memory is already installed, part of that address space must be reserved by the graphics memory mapping. Graphics memory mapping overwrites a part of the system memory. These conditions reduce the total amount of system memory that is available to the operating system. The reduction in available system memory depends on the devices that are installed in the computer. However, to avoid potential driver compatibility issues, the 32-bit versions of Windows Vista limit the total available memory to 3.12 GB. See the "More information" section for information about potential driver compatibility issues. If a computer has many installed devices, the available memory
may be reduced to 3 GB or less. However, the maximum memory available
in 32-bit versions of Windows Vista is typically 3.12 GB. WORKAROUND Note When the physical RAM that is installed on a computer equals the address space that is supported by the chipset, the total system memory that is available to the operating system is always less than the physical RAM that is installed. For example, consider a computer that has an Intel 975X chipset that supports 8 GB of address space. If you install 8 GB of RAM, the system memory that is available to the operating system will be reduced by the PCI configuration requirements. In this scenario, PCI configuration requirements reduce the memory that is available to the operating system by an amount that is between approximately 200 MB and approximately 1 GB. The reduction depends on the configuration. Read wkole Microsoft support article here. -- © 2007 Microsoft Corporation.
|