Memory Mapped IO, video cards, and total usable RAM

Maverick2002

Diamond Member
Jul 22, 2000
4,694
0
0
Hi,

I'm trying to see if there's any sort of quantitative way of measuring how much usable RAM is actually in a system. In particular, this is with regards to 32-bit operating systems.

With 4GB installed, various systems will (typically) report something like 3.2-3.8GB of usable RAM. From my understanding this difference is based on the amount of RAM the various components require in order to function. So here are my questions:

1) Is there a way to calculate/find out how much RAM each component needs, i.e. how much it's subtracting from the 4GB?
2) Is there a quantitative figure on how much RAM a dedicated video card requires? Let's say you have a dedicated graphics card with 1GB of RAM on it ... how much will it suck up from your 4GB?
 

Maverick2002

Diamond Member
Jul 22, 2000
4,694
0
0
Interesting, just got done reading this article: http://dansdata.com/askdan00015.htm

It begs the question though ... all of that extra GB of dumping ground for a 32bit OS between 3-4GB that's reserved for components - does it actually increase your performance since there's reserved memory now? Or is it a complete waste? The article didn't specify.
 

JackMDS

Elite Member
Super Moderator
Oct 25, 1999
29,545
422
126
When working a computer is a Dynamic device and their is constant internal interaction.

You can not calculate "needs" you can get a picture of current situation that you look at it.

This (when configured correctly with the Show memory option) shows the processes running and the memory that they use.

http://technet.microsoft.com/e...nternals/bb896653.aspx

When running pull down the View menu, choose Select Columns, and look at the memory Tab. check the variables that you have interest in.


And VMMap, Process Virtual and Physical Memory analysis utility, http://technet.microsoft.com/e...nternals/bb896653.aspx
 

Paperdoc

Platinum Member
Aug 17, 2006
2,459
353
126
Any OS will reserve certain chunks of RAM for its own exclusive use. Some of that - usually about 0.3 to 0.4 GB - is used directly for various OS functions. Some of that is actually used for storing and retrieving data the OS uses. Some is actually memory mapped. That is, the actual RAM is not used, but data destined for that RAM address is actually sent to separate RAM on some peripheral card, usually its I/O buffers.

The biggest single chunk of RAM reserved is for the video system. If you have a simple system with on-board graphics that uses system RAM for the video, then that actual RAM is used directly for that function. But even if you have a video card with its own RAM, the OS still has to be able to get at it by specifying which video RAM locations to read and write, and this is limited by the OS's ability to generate addresses. With a 32-bit system, the addressing bus is only capable of working with RAM located up to 4 GB. So the physical RAM on the video card is used, but to communicate with that RAM, the OS maps a portion of the range just below 4 GB (in terms of its ability to generate addresses) to that physical RAM. This means that same address space cannot be used to access the main RAM on the motherboard in that area, and it is not available for any use. If you have 4 GB of real mainboard RAM installed, that video RAM size appears to be used as RAM reserved by the OS, also. So if you have a video card with 512 MB of on-board RAM, that 512 MB appears NOT free for use by anything else. Add this to the .03-0.4 GB already actually used by the OS, and your "lose" 0.8 GB or more from your real 4 GB of RAM.

Now, suppose you have 2BG of RAM installed and that big video card with 512 MB of its own RAM. The 32-bit OS will still reserve 0.3 to 0.4 GB of RAM for itself, but it may be able to map the 0.5 GB of addressing space still required to reach the video RAM to up above the 2 GB position. So, although it is using 0.5 GB of addressing space for that, it is NOT using addresses that overlap the real 2GB of RAM. You appear to have about 1.6 GB or more "free", so you've only "lost" that basic 0.4 GB. But when you put in 4 GB instead of 2, there is no way to avoid having the video RAM address space overlap with main board RAM address space, as long as you are still using a 32-bit OS.

Switch to 64-bit OS and the picture changes drastically. Now the addressing capabilities are huge compared to the actual RAM one can find and install. Even with the artificial hardware limit of 16 GB referenced in the link provided by Maverick2002 above, right now you can't buy and install more RAM than that anyway. So now you have two options. One is to stick with 4 GB of main board RAM and set it up (just like a 32-bit system with only 2 GB RAM) so that the video addressing is mapped is to address space above 4 GB and it does not overlap with real RAM. The other is to get big with RAM (like 8 GB) and let it use that upper 0.8 GB or more and just don't care because you got lots, anyway!

For your original question, you can try this approximate way. Windows will reserve for its own direct use about 0.3 GB, sometimes a little more. That amount will be used no matter how much RAM you have installed. IF you have on-board video using main mobo RAM, look for the specs' of how much main RAM the video chip uses. That also will be used, leaving you with whatever is left over as free RAM space. However, if you have an added video card with its own RAM, how much impact that has depends on how much total mainboard RAM you have installed. If you have no more than 3GB of main RAM, chances are your OS will map its video card addressing range into the area that has no main RAM anyway, so you won't appear to lose any more than that 0.3 GB. But if you have 4GB of mainboard RAM, the amount you "lose" because of mapping addresses below 4GB (in addition to the 0.3 GB or so already used by the OS) is exactly the amount of RAM on your video card.

For a practical example, assume you are using 32-bit Windows as your OS and have a 512 MB video card installed. If you put in 2 GB of main RAM, you'll actually have about 1.6 to 1.7 GB free for application use. Don't forget that any application you have set up to load automatically every time will cut into this space. If you take your machine up to 3 GB installed, you'll have about 2.6 to 2.7 free. If you go to 4 GB installed, you'll have 3.1 to 3.2 GB free. So, going from 2 GB to 4 GB installed actually will pretty well double the free RAM space. What about the in-between option of 3 GB? It's a whole 1 GB more than the starting point and only 0.5 GB less than the max. But at today's pricing, 2 x 2GB or 4 x 1GB of RAM could be the same price as 2 x 1GB plus 2 x 512 MB of RAM.
 

Maverick2002

Diamond Member
Jul 22, 2000
4,694
0
0
Thanks for the explanation. It's not a price issue; more curiosity than anything else. Is there a case where using 4GB would actually net you less usable RAM (say if you had a video card with almost 2GB of RAM) than 3GB?
 

WobbleWobble

Diamond Member
Jun 29, 2001
4,867
1
0
Originally posted by: Maverick2002
Thanks for the explanation. It's not a price issue; more curiosity than anything else. Is there a case where using 4GB would actually net you less usable RAM (say if you had a video card with almost 2GB of RAM) than 3GB?

No, the end result would be the same.
 

0roo0roo

No Lifer
Sep 21, 2002
64,795
84
91
Originally posted by: Maverick2002
Interesting, just got done reading this article: http://dansdata.com/askdan00015.htm

It begs the question though ... all of that extra GB of dumping ground for a 32bit OS between 3-4GB that's reserved for components - does it actually increase your performance since there's reserved memory now? Or is it a complete waste? The article didn't specify.

its not reserved ram, its reserved memory addresses. the addresses are already taken, so the ram cannot be seen. its like if i somehow named myself maverick2002 but since you were using it, i'd just not exist for all intents and purposes. everytime the system would deal with maverik2002 it would look at you, and ignore me.
 

tcsenter

Lifer
Sep 7, 2001
18,893
544
126
Originally posted by: Maverick2002
1) Is there a way to calculate/find out how much RAM each component needs, i.e. how much it's subtracting from the 4GB?
Yes, plug it in and look at the memory addresses reserved to the device.

2) Is there a quantitative figure on how much RAM a dedicated video card requires? Let's say you have a dedicated graphics card with 1GB of RAM on it ... how much will it suck up from your 4GB?
Yes, plug it in and look at the memory addresses reserved to the device.

Seems to say that 8GB is definitely usable on a 32-bit OS, albeit with some potential problems.
Might as well use 64-bit OS. Hacking the 32-bit Windows kernel to fully utilize PAE gives you all of the risks but only one of the benefits of 64-bit.


 

tcsenter

Lifer
Sep 7, 2001
18,893
544
126
Originally posted by: Paperdoc
The biggest single chunk of RAM reserved is for the video system.
Nearly all graphics cards are given 256MB chunk of address space through which to reach all its onboard RAM, whether 256MB, 384MB, 512MB, or 768MB. The greatest consumer of address space for devices is not the graphics card, but the Southbridge I/O devices. Intel's ICH requires ~700MB just for a fully implemented Southbridge, before you install a graphics card.

So if you have a video card with 512 MB of on-board RAM, that 512 MB appears NOT free for use by anything else. Add this to the .03-0.4 GB already actually used by the OS, and your "lose" 0.8 GB or more from your real 4 GB of RAM.
Graphics RAM is not mapped to physical address space on a 1:1 basis. This may help clarify things:

RAM, VRAM, and More RAM: 64-Bit Gaming Is Here