4GB || ! 4GB Memory (RAM) on 32-bit operating system
As we all know, when we run an application on a computer, the operating system will first load it into memory from a hard drive and then execute instructions and do calculations based on data in the memory. Most operating systems (such as XP, Vista) allow people to do multiple tasks simultaneously and load several applications into memory at the same time. To enable this feature only part of the code and data will be loaded into memory for each application. When code or data not in memory are needed, the operating system will generate a Page Fault Exception and start the paging procedure to load the missing part into memory from a hard drive. Obviously, this paging process impacts the application performance as it takes time to read data into memory. Even worse, if there is no free space in memory, operating system has to pick some "victim" pages, save the contents back to hard drive, and then load the data into those page frames. So the capacity of memory in computer is one of the key factors of performance. The bigger the memory is, the more applications and data a computer can hold in memory, and the faster the computer can run.
Nowadays RAM price is quite reasonable, and people are willing to pay a little bit extra money for memory to increase performance on the box. But how much memory (RAM) can people plug into their box? Taking a 32-bit XP or Vista operating systems, which most people have used or are using, as an example, the operating system only allows access to about 232 of total computer address space; 4GB is the technical upper limit. What does “technical upper limit” mean?
Can someone just plug 2 sticks of 2GB memory into the motherboard and have a full 4GB available for use? Let’s check this out on a system to see whether people get what they pay for.
When rebooting a computer after we plug in 4GB of memory, we go into the BIOS and check that the size of RAM shown is 4096MB. So far, so good. Let’s dig deeper to confirm this 4GB memory is recognized by the operating system. After the Windows starts up, by choosing “Computer” from start button, and then right clicking on it and then choosing Properties, we should see “Memory (RAM):“ on screen is 4.00 GB (see below).
Yes again. The operating system confirms that 4GB of memory has been installed in this computer.
It looks like everything is set correctly. Now, let’s check the number on Windows Task Manager. First, open Task Manager, and then click the Performance tab.
Look at the Physical Memory (MB) value. Shouldn’t the total be 4096, instead of 3566? HELLO, WHERE IS THE MISSING 530 MB? Why do the BIOS and System Properties tell me I have 4 GB RAM installed on my box, but Windows Task Manager tells me I don’t?
Well, both of them, 4GB and 3566 MB, are correct. 4GB is the total size of memory which has been installed on computer, and 3566 MB is the total amount of memory that is available on this computer. Or I should say 3566 MB is the total amount of address space that the operating system can assign to RAM.
Theoretically, a 32-bit operating system should support a 232 physical address spaces from 0x00000000 to 0xFFFFFFFF which is 4GB. But not all of this address space is available for RAM. Some of the address space is taken away by other devices, such as the video card or USB controller. When someone buys a nice graphic card with 256 MB video memory on it, the operating system needs to assign a range of address space to the video memory, so it can have access to all of that video RAM on the card.
We can take a look at how much memory space is reserved for each device by opening the Device Manager, changing the view to Resources by Type and expending the Memory tree view. From this dialog (see below), we can clearly see how the physical address space from 0x00000000 to 0xFFFFFFFF has been assigned to the devices on my box. Memory is only one of them.
To verify the RAM allocation, I ran an application called MemInfo.exe (it can be downloaded at https://www.winsiderss.com/tools/meminfo/meminfo.zip) which reports there are 3 address ranges that have been assigned to memory. If we accumulate these 3 numbers together (and divide by 1024 to get MB), we see that the operating system has allocated 3565.35 MB of the physical address space to RAM. This matches the number on Windows Task Manager.
Therefore to those people who want to fully use every byte of their 4GB memory in their computer, it will be a good idea to consider migrating to one of the 64 bit operating systems.
- Shaoying
Comments
Anonymous
November 24, 2008
I recently went through this when I put a 1 GB card in my machine and suddenly had only 1/2 of my memory available. Needless to say, I did migrate to Vista 64 pretty quickly after that, and am quite happy with it.Anonymous
January 19, 2009
(本文由作者译自其 英文博客原文 ) 正如我们知道,每次当我们在计算机上运行应用程序的时候,操作系统会把程序从硬盘加载到内存中,然后根据内存里的数据来执行指令或者进行运算。大多数操作系统(如XP, Vista)可以让用户同时处理多个任务,并且可以同时执行多个应用程序。为了最大限度的利用内存,操作系统只会把应用程序当前使用的部分代码和数据加载到内存中。每当应用程序需要用到那部分不在内存的代码或数据时,操作系统就会产生一个内存页面异常,并开始把所需的代码或者数据从硬盘加载到内存中。很明显,整个过程会降低应用程序的性能,因为把数据读取到内存中需要些的额外时间。更糟糕的是,如果内存中没有可用空间了,操作系统会根据算法挑选一些内存页面,把其中的内容写回硬盘,然后再把所需要的数据加载到这些页面中。所以,内存的大小是一个影响计算机性能的关键因素。内存越大,越多应用程序和数据可以被加载在计算机内存里,然后计算机可以更快得运行