• NOW LIVE! Into the Woods--new character species, eerie monsters, and haunting villains to populate the woodlands of your D&D games.

A Quick Question on RAM and 32-bit OS

Out of the 4Gb some of the memory is used by the kernel and the rest by user processes. By default windows (at least used to) allocate memory mappings to kernel above the 2Gb and User below the 2Gb so that if you had a lot of memory then you only got to see 2Gb of it. Then they changed it a bit and went to 3Gb User 1Gb kernel and I lost track of what happened after that. When you have 4Gb the kernel including graphics card will sit at the top of the RAM space and the user memory starts at the bottom. I don't know exactly when the two collide but I believe that there can be a hole which is totally wasted as nobody can use it. However that kernel memory with graphics card is being used even though you cant use it in your programs - i.e. if you had less memory not to waste the hole then the kernel would burn more of what would have been user memory. The graphics card uses a lot of memory because it buffers stuff like large textures in RAM before sending it up to the card or has page lock tables sat there. It does this because by reserving a large window space of physical addresses, it can DMA the data instead of wasting the CPU time sending it. So that texture in your game is in your user space to start with until the game thinks it needs to go up to the card then the texture is transferred by the game in chunks into this kernel memory and then the process is started to send it to take it to the card which is slow across a PCIe bus. The DMA engine starts feeding it to the card and the CPU carries on so not having to wait around.

So assuming that stability is assured, having 4Gb is better than 2Gb. But if memory was very expensive then you would be more cost efficient to get just 3Gb.

Oh and just to add, you need a 64 bit CPU to run a 64 bit OS too. Athlon64, PentiumD, Core2 etc all fine - older ones not so fine !
 

log in or register to remove this ad


I am curious why 32 bit Windows 2008 Enterprise Servers can recognize up to 64 gigs; interesting.

Almost all x86 CPUs now -- and most x86 server CPUs for a long time (way back in the Pentium II Xeon days) -- have supported 36-bit memory addressing via 'PAE'. That gets you a 64 GB address space. And in fact, PAE support is enabled by default in all modern versions of Windows, because it's also used for some security features (incidentally, current desktop 64-bit CPUs, even when running in 64-bit mode, really only allow a 40 - 48 bit physical address space, because, well, 1 - 256 TB of physical memory is probably plenty...).

So why can't you access all 4GB of physical memory and your video card that way? Well, a great many 32-bit drivers don't behave well if they're trying to deal with addresss above 4GB. So Microsoft only supports >4GB of memory in really expensive enterprise server versions of 32-bit Windows that ship with dedicated hardware. However, this is something of moot point in the long run, because Windows Server 2008 is the last server version of Windows that will have 32-bit versions; Windows Server 2008 R2 (the server companion to Windows 7) is 64-bit only.
 

Almost all x86 CPUs now -- and most x86 server CPUs for a long time (way back in the Pentium II Xeon days) -- have supported 36-bit memory addressing via 'PAE'. That gets you a 64 GB address space. And in fact, PAE support is enabled by default in all modern versions of Windows, because it's also used for some security features (incidentally, current desktop 64-bit CPUs, even when running in 64-bit mode, really only allow a 40 - 48 bit physical address space, because, well, 1 - 256 TB of physical memory is probably plenty...).

Oh. I was confused because your early post states 16 GB.

Thanks for the explanation.

4. Although almost all current CPUs support 'PAE' which allows 36-bit memory addressing, a lot of 32-bit drivers have issues with being mapped to memory above 4 GB. So only server versions of 32-bit Windows support this feature (which allows up to 16 GB of address space).
 

Oh. I was confused because your early post states 16 GB.

Minor mental math error on my part. A 36-bit address space gets you 16 times the address space of a 32-bit address space (because 2^4 = 16). Somehow the 16 stuck in my head, instead of going through and multiplying 16 * 4 = 64.
 

Neat. I am deploying Windows 2008 on an older server with 8 GB of Ram; not my preferred platform, but there you go.

I have Windows XP on my home PC; only 2 GB of RAM. I'll probably wait for Windows 7 to upgrade.
 

Okay, trying to clear up a lot of misconceptions here...
Well, then I have a clarification for item #2. :)

2. Many devices, most notably the video memory in your video card, are mapped to some of that address space because memory-mapped I/O is much faster than any other means of communicating with them. If address space is used by devices, then the memory that would correspond to it cannot be used. This is why you won't see all 4 GB you have installed under 32-bit desktop Windows.
This is a limitation of the operating system, and not necessarily the hardware. It depends on how the address lines are attached to the MMU.

The MMU can be programmed to allow certain logical addresses (those that the CPU is manipulating; sometimes called effective addresses, too) to become physical addresses on the address bus, perhaps with some trickery to modify the top few bits. But this does not require that the real system RAM in those locations be wasted!

In fact, the OS could remap lower logical addresses via the MMU so that said address was in the bottom 2GB (for example) and the physical RAM address was in the area being shadowed by the video RAM.

It's entirely possible that Windows doesn't bother with this optimization due to the variety of hardware it must support and it just wastes your RAM, but other operating systems (think Unix and Linux) will make use of all physical RAM in the machine, assuming the hardware is capable of it. In other words, there is no hardware implementation limit that says video RAM must replace system RAM; this is a system design constraint.

Now on the really low-end hardware, your video RAM might be extremely small (like 32MB or something) and that memory is only used at boot time. Once the OS is running it allocates system RAM to act as video memory and programs the video card to retrieve its data from there. This is generally much slower, though, and that's why the high-end video cards come with 256MB or 512MB of on-board RAM. By having on-board RAM, the video card can be accessing its memory while the CPU is accessing its memory and there's no contention for the system bus. I've got an old POS eMachines that does this. (But hey, my final cost for the 64-bit box was $300 back in 2004, so I'm not complaining. :))
 
Last edited:


Into the Woods

Remove ads

Top