4GB in 32-Bit O/S

jaydub868

Distinguished
Oct 14, 2007
50
0
18,530
I understand that if you install 4GB of RAM in a rig that has a 32-bit O/S, the O/S will only recognize about 3GB's of this memory, with the remainder dedicated to system resources. Sound logical. Why, then, does a 32-bit O/S recognize the full amount of memory when only 2GB's are installed. With 2GB's installed, wouldn't it also be true that a portion of that is being dedicated to system resources?
 
The memory after the 3GB or so is not "dedicated to system resources"; rather, system resources have used up the remaining memory *addresses*, so the memory cannot be seen nor used by anything, as it has no address. When 2GB RAM is installed, system components taking up 1GB or so of addresses has no effect, as there are 4GB of addresses in total, meaning 3GB of addresses are left available for the 2GB of RAM.


 
Basically, a 32 bit Operating system can provide addresses for up to 4GB, defined in this case as 2bits to the 32nd power worth. At that point the Operating System runs out of address due to mathematical limitations. That 4GB includes any memory on the Mobo, devices need addresses, your video RAM needs addresses, then comes the system stuff. When there aren't enough addresses for everything, they get assigned in order of importance, your DIMMS coming last in line.


http://www.codinghorror.com/blog/archives/000811.html

Yes, you can use PAE extensions, which basically hide what's going on with memory from drivers/apps. And this works.... Right up to the point where something that isn't written to use PAE tries to access a memory address directly. Then it's crash time. And you would be correct in presuming that most drivers for consumer based products are not written to use PAE. Microsoft does not support PAE on consumer operating systems for this reason. You can enable it on some MSFT OS's, but you'd be wise to do your homework on whether or not your apps and drivers can use PAE.



Fort your 2GB scenario the OS has enough addresses, so therefore your OS 'sees' it all.
 
OK, thanks for the lesson. But assuming system resources use 1GB (for simplicity's sake), then that means 3GB is available for O/S and apps on a 4GB system and 1GB is available for O/S and apps on a 2GB system. So, how is memory "wasted" when you go to a 4GB configuration? O/S and apps gain access to an additional 2GB's of memory, regardless of what is being reported by Windows.
 
The memory isn't "wasted". You seem to be stuck on the thought that the only memory your computer has is contained in the DIMMS. This is incorrect.


When you install 4GB worth of memory sticks in the slots on your motherboard, you need to understand that is In Addition To a small amount that's built into your Mobo, plus however much is in your Video Card. Devices also take up some addresses, and anything with a cache needs to have that cache addressed as well.

So: Mobo has a few meg built into it, your video card has 250GB~1000GB, your processor has few MB cache, plus a few hundred more Kb for your device addresses, including the 8/26/32MB cache in your hard drive and that sort of thing. After all that has been done, then comes the 4GB worth of DIMMS you installed on your Motherboard. ALL of these need to be fully addressed so your Operating System, drivers, and applications can communicate to them. But the total in this case is much more than 4GB.

So what happens is your Mobo claims the first addresses, then the cache on your CPU, then the cache on your HDD, then however much your other devices need, then however many addresses your video card needs. All of this comes out of the 4GB total. WHAT IS LEFT OVER after the rest of your comp is handled can be used for your installed DIMMS. In this case there is 4GB worth of DIMMS, but a large chunk of addresses have already been assigned to other purposes. So the system assigns however many addresses remain. Again: 4GB worth of potential addresses, less Mobo, Devices, Caches, and Video memory. Whatever is left over is used for your system memory. And that is how you get to 3GB~ish displayed memory in your OS.

In the case of 2GB of RAM, your system still assigns from the same 4GB pool of addresses. So you have the 1GB~ish total for your system, followed by the 2GB DIMMS. The total is less than 4GB, therefore you will see all of the RAM.
 


A 32 bit os can only generate/speak to/address 4 gig of memory space. When you have less than 4 gig of system RAM ( say 2 gig of DIMMS) then the OS has enough addresses to use all of it AND your video ram and other devices with memory. When you install 4 gig of DIMMS the os would have to use ALL addressing ability to talk to the four gig and would have no numbers left over for the other devices. Hence the 1 gig (+ or -) reservation.

Just remember this; the OS can only generate 4 gig total addresses due to it's mathamatical design. It can't count any higher than that.
 
sometimes a drawing is more understandable:

[fixed]In normal mode, the CPU can address this much:

+---------------+ 4GB
| |
| |
| |
| |
| |
| |
| |
| |
+---------------+ 0

Now you put your stuff in this address space:

+---------------+ 4GB
| BIOS, PCI |
| GFX, ETC... |
|---------------+ 3 GB
| EMPTY |
| |
|---------------+ 2 GB
| |
| RAM |
| |
| |
+---------------+ 0

If you put another 1GB RAM into there, it will be fine, because you still have 1GB of EMPTY space.

But if you put another gig (4 total), then you have an overlap. The last GB will be hidden behind pci and gfx, so Windows cannot reach it, and it will be "lost".

Memory remapping can solve it, by moving the last gig above pci and gfx, but then you'll need an OS than can go beyond 4GB, which 32-bit xp and vista cannot do.[/fixed]

 
No, the CPU (in normal 32-bit mode) can address this much. As someone else mentioned in the thread, the cpu can be switched into PAE mode, which allows it to address 64GB (as also mentioned, xp/vista doens't support this large address space, but other 32-bit systems do)
 
When operating a 64-bit CPU you switch it into 64-bit mode before the very large address space becomes available. In AMD language, this is called LONG mode
 
yes, the cpu is capable of much more than 4GB, if running in another mode.

In normal mode (not in PAE mode), the address space is 4GB. The page table cannot address beyond 4GB in this mode.
 
[fixed]To clear things up. Switch the cpu into PAE mode, and remap the lost ram, and it may look something like this (seen from the CPU):

+---------------+ 64GB
| |
| |
| |
| |
| |
+---------------| 5GB
| RAM |
| |
+---------------+ 4GB
| BIOS, PCI |
| GFX, ETC... |
|---------------+ 3GB
| |
| |
| |
| |
| RAM |
| |
| |
+---------------+ 0

And then comes the xp/vista part. Even in PAE mode, they cannot go beyond 4GB

[/fixed]
 
no, the page table is used by the CPU to translate virtual addresses into physical addresses. This page table changes, when you change the mode the cpu is running in
 
Microsoft also says something about this in one of those articles, where they mention REALLY bad writtten drivers that modify the page table directly. If not PAE aware, they mess everything up, because the structure of the table changes in pae mode
 
yes, 2x1 + 2x512 is possible. Right now, i'm running 2x512 + 2x256

1x1 + 2x512 might also give dual channel, it all depends on the memory controller
 
Really just wasting your hard earned cash. As was said earlier, the amount of RAM address space that is available is dependent on your hardware configuration. These newer VGAs with a lot of memory are pushing the available addresses down below 3G. I have seen posts that some mobos don't like having slot 4 populated so you could run into problems there. Even if you are using 3G you would still want to populate all 4 slots to gain the advantage of dual channel, which I have found isn't as much as we are led to believe. Unless you really need the RAM I would, use only 2 1G sticks. It's really more than sufficient for most tasks. If you really want 4G knowing that you will loose at least 1G, I would use 2 2G sticks in slots 1 and 2 to eliminate any possibility of populating the 4th slot causing problems with the mobo. I don't know how common these 4th slot problems are so you may be able to navigate the mine field and go with 2 1G and 2 512M sticks. Also if you use the 2G sticks be sure your mobo supports them.