rss

Wednesday, August 12, 2009

As more and more of us load up our systems with lots and lots of RAM, this question surfaces more and more. You put 4GB in your computer. The motherbo

As more and more of us load up our systems with lots and lots of RAM, this question surfaces more and more. You put 4GB in your computer. The motherboard supports 4GB, Windows XP and Vista support 4GB, so everything is fine.

But when you open the System applet in Control Panel, the system tells you that there is 3.5GB, or maybe 3 GB even. Where did the rest go?

It turns out that these systems have a 4GB address space, which must be used to address physical RAM, as well as other things. This is addressed in the Microsoft document Memory Management: What Every Driver Writer Needs To Know. In particular, the fourth full paragraph on page 10 says:

The physical address space is used to address more than just RAM. It is also used to address all of the memory and some of the registers presented by devices. Consequently, if a machine is configured with the maximum amount of physical memory, some of that memory will be unusable because some of the physical address space is mapped for other uses.

So the machine must use that 4GB address space for other things besides your RAM. But what other things?

I recently had a new Dell Optiplex computer put on my desk at work. Being curious, I went to the Dell web site and found the manual for this computer. In that document, it says this:

This computer supports a maximum of 4 GB of memory when you use four 1-GB DIMMs or two 2-GB DIMMs. Current operating systems, such as Microsoft® Windows® XP, can only use a maximum of 4 GB of address space; however, the amount of memory available to the operating system is less than 4 GB. Certain components within the computer require address space in the 4-GB range. Any address space reserved for these components cannot be used by computer memory.

The following components require memory address space:

  • System ROM
  • APIC(s)
  • Integrated PCI devices, such as network connectors and SCSI controllers
  • PCI cards
  • Graphics card
  • PCI Express cards (if applicable)

At start-up, the BIOS identifies the components that require address space. The BIOS dynamically calculates the amount of reserved address space required. The BIOS then subtracts the reserved address space from 4 GB to determine the amount of usable space.

If the total installed computer memory is less than the usable space, all installed computer memory is available for use only by the operating system.

If the total installed computer memory is equal to or greater than the usable address space, a small portion of installed memory is unavailable for use by the operating system.

The first thing that I see on this list is “Graphics card”. Video cards nowadays commonly have one or two hundred MB of RAM on them. That video RAM takes up part of the 4GB address space, which then is not available for your physical RAM.

With all of that understood, I’m still hard pressed to fugure out where an entire GB of address space goes.

Another very good discussion of this topic is HP's RAM Allocation with Microsoft Windows XP Professional (32 & 64-bit).

The ultimate solution to this is 64-bit computing. A 64-bit computer running a 64-bit operating system will have an enormous address space. The Microsoft document referenced above says that 32-bit Windows XP allows 128GB of RAM. That's 37 bits of address space. (a full 64-bit address space would be something like 18 quintillion (18x1015) bytes. I don't think any hardware or software manufacturer is to that point yet.) That system would have no problem accessing every bit of your 4GB of RAM.

What about the /3GB switch?

It doesn't apply.

The /3GB switch in the boot.ini file affects the way Windows XP allocates the 32-bit virtual address space that each process gets. By default, that address space is split evenly between the operating system and the program. The /3GB switch forces the OS to allocate 3GB to the program and only 1GB to the system. This can result in the OS being squeezed and not working efficiently. It's necessary for only a very few, extremely RAM-hungry programs. It will not make your missing physical RAM reappear.

0 comments:


Post a Comment