computer architecture - What is the maximum amount of ram a 64bit machine can theoretically address?

08
2014-07
  • KingNestor

    I'm reading through my computer architecture book and I see that in an x86, 32bit CPU, the program counter is 32 bit.

    So, the number of bytes it can address is 2^32 bytes, or 4GB. So it makes sense to me that most 32 bit machines limit the amount of ram to 4gb (ignoring PAE).

    Am I right in assuming that a 64bit machine could theoretically address 2^64 bytes, or 16 exabytes of ram?!

  • Answers
  • Nate Koppenhaver

    Theoretically: 16.8 million terabytes. In practice: your computer case is a little too small to fit all that RAM.

    http://en.wikipedia.org/wiki/64-bit#Limitations_of_practical_processors

  • Conrad.Dean

    To supplement Matt Ball's answer, the current largest stick of RAM I can find on one particular online retailer is 32GB. It would take 32 of these to reach 1 terabyte. At about a half inch per stick this brings us to a devoted 16 inches of space on your motherboard for a terabyte of commercial ram. To reach 16.8 million terabytes would require a motherboard 4,242.42 miles. The distance from LA to NYC is about 2141 miles, so the motherboard would stretch across the country and back to accomodate that much RAM.

    Clearly this is impractical.

    How about we didn't put our RAM all in one row like on most motherboards, but instead placed them side-by-side. I want to say the average stick of ram is about six inches long, so if we allow a half an inch for width, you can have a square unit of 12 sticks of ram in a 6 inch square. Let's call this square a RAM-tile. A RAM-tile then holds 384GB of RAM. To reach the required 16.8 million terabytes in 384GB tiles would take 44.8 million tiles. Let's be messy, and use square root of that to conclude that this will fit in a square of 6693 by 6694 tiles, or 13,386 by 13,388 feet, which is close enough to 2.5 miles squared, enough to cover downtown Seattle in shadow, as if they didn't already have enough to complain about.

  • Adam Wright

    Effectively, yes - processes could, in theory, address 2^64 bytes of memory. But as you pointed out, there are ways around this limit.

  • decasteljau

    You would be correct. You can address up to 16 exabytes of RAM. Now.. whether the operating system can handle it would be another question....

  • Mark Ransom

    The biggest advantage to 64 bits is not the RAM it can address, but everything else. You can define an address for every byte on a disk, for example, and increasing disk capacities will not invalidate this for decades.


  • Related Question

    memory - How can I enable PAE on Windows 7 (32-bit) to support more than 3.5 GB of RAM?
  • Niphoet

    I know that Windows XP 32-bit can be configured, through PAE, to support more than 3.5 GB of RAM. Is there a good tutorial to do this with Windows 7 32-bit?

    As to why I don't simply use 64-bit Windows 7: The software for my Internet connection (cell phone-as-modem) will only work in 32-bit environments.


  • Related Answers
  • Breakthrough

    A few years ago, a group of programmers have released a kernel patch for Windows 7 to allow the usage of more than 4 GB of RAM under Windows 7. Recently, due to some virus scanners detecting the patch as a false positive, the download was removed from the website. Fortunately, I have saved a copy of the patch (which uses the RTM Windows 7 kernel), and uploaded it to my website here (see option #1 when I discuss the two methods to patch your Windows kernel). Furthermore, the authors have posted instructions on how to patch your kernel manually.

    Even if you have Windows 7 SP1 (Build 7601), you can install the patch which contains kernel 7600. This is because your default kernel is not modified; a new one is copied to your system folder, and an additional boot menu option is added to boot Windows with the new, patched kernel instead of the older one. While I haven't found any problems running Windows 7 SP1 with the older kernel, if you do wish to use build 7601 of ntkrnlpa.exe, you need to manually patch your kernel (see the link above).


    The patch basically modifies the Windows 7 Kernel to be more like the Windows Server 2003 Datacenter Edition, which is compatible with up to 8 GB of RAM under 32-bit mode. This allows you to extend the PAE well into 8 GB of RAM under Windows 7 32-bit. For more information about why Microsoft implemented this technical limitation, see Licensed Memory in 32-Bit Windows Vista (requires JavaScript to be allowed from www.geoffchappell.com).

    As mentioned above, note that individual processes will still be limited to 4 GB even if the system can access more... Although if you had 8 GB of RAM, then at least you'd still have another 4 GB for other processes ;)


    For those interested in the technical aspects, this happens because of memory-mapped input/output (MMIO for short). This allows a CPU to access both peripherals and RAM through the address bus itself. Usually this is done though the higher-order memory addresses to avoid lower-order address conflicts. However, this gave rise to the commonly known 3 GB Memory Barrier in all consumer variants of 32-bit Windows operating systems.

  • Peter Mortensen

    This article at Microsoft's MSDN site shows the memory limits for versions of Windows and Windows 7 32-bit is listed as a 4 GB limit.

    You used to be able to use PAE to see more than 4 GB of RAM with Windows XP but this option was disabled in Service Pack 2.

    The reason was that most drivers weren't PAE aware and threw their toys out of their pram if they ended up in memory above the 4 GB boundary.

    If you use the /PAE switch now on Windows XP you'll make DEP available, but you won't be able to see more than 4 GB of RAM.

    This 4 GB limit is still in place for Windows 7 32-bit. If you want to see more than 4 GB of RAM you will have to use a 64-bit version of Windows.

    (This option to use PAE to see more than 4 GB of RAM is still available on 32-bit Server versions of Windows which I assume is down to a better quality of drivers expected for the kind of hardware you'd run Windows Server on.)

  • grawity

    PAE should be enabled by default - Windows already uses it internally for the DEP/No-Execute feature.

    But these instructions might help if Windows is doing its thing again.


    Note that individual processes will still be limited to 4 GB even if the system can access more.

  • Joshua

    If your system can support it, you can use virtualization to allow access to your 32-bit phone drivers.

    It would be a slightly more complicated setup but you could set up a virtual machine that made the connection and did internet connection sharing to your host, that way you get the benefits of 64-bit as well as being able to use legacy drivers.

    VMware Workstation (commercial), VirtualBox (free, open source), and Windows Virtual PC (free) can all route usb devices directly into your virtual machine. Just install a 32-bit OS (even XP if you wanted), give it a marginal amount of RAM and you can do what you need. I've done this to load legacy applications that didn't support Windows 7 and my brother actually loaded his old Creative webcam (with no 64-bit drivers) and used Skype through his virtual machine.

  • Community

    Windows 7 32 has PAE disallowing access past the 4 GB mark. See http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx for details.

    For people out there who insist on 64 bit usage - there are some things that would not work in 64 bit environments that could benefit a performance gain from a ram disk that COULD access past the 3.25 mark in a 32 bit environment - specifically applications that page often. You could also put the page file within said ramdisk. In addtion, a VM is great, however emulation never really works as great as the real thing -- it all really depends on the application and the way it is implemented. There are still many hardware devices that will not work in a 64 bit world, and need the real time access to make them work well (while there are accelerators that help with real time access, it can still present problems.)

    So, while 64 bit is technically superior, 32 bit is a legacy that will take a while go away, and there will be plenty of reason why people would like to access memory through PAE.

    PS: There is a reply to this post stating that putting a page file on RAM disk makes no sense. Let me explain. If the system has 4GB RAM and you make a 2GB RAM disk and put the page file there, then yes, this configuration makes no sense. However, if the system has 8GB RAM and you make a 4GB RAM disk (accessing the extra memory that 32 bit Windows can not reach) and put the page file (and temp folder, and turn on "ReadyBoost" and add any other frequently used files) on there, then yes, the speed up is very considerable. And "yes" is the answer, you can get software that allows you to create RAM disks above the 4GB limit on 32bit systems.

  • Ste

    DO NOT USE THE PATCH, its simply a german test version of windows, and will muck up youre boot record.

    I have just spent an hour downloading easybcd on another machine to fix this.

    Be warned!

  • Oliver Salzburg

    According to the MSDN article Physical Address Extension:

    Windows automatically enables PAE if DEP is enabled on a computer that supports hardware-enabled DEP, or if the computer is configured for hot-add memory devices in memory ranges beyond 4 GB. If the computer does not support hardware-enabled DEP or is not configured for hot-add memory devices in memory ranges beyond 4 GB, PAE must be explicitly enabled.

    To explicitly enable PAE, use the following BCDEdit /set command to set the pae boot entry option:

    bcdedit /set [{ID}] pae ForceEnable
    

    IF DEP is enabled, PAE cannot be disabled. Use the following BCDEdit /set commands to disable both DEP and PAE:

    bcdedit /set [{ID}] nx AlwaysOff
    bcdedit /set [{ID}] pae ForceDisable
    

    Windows Server 2003 and Windows XP: To enable PAE, use the /PAE switch in the boot.ini file. To disable PAE, use the /NOPAE switch. To disable DEP, use the /EXECUTE switch.

  • Pablo Molina

    The question is “How can I enable PAE on Windows 7 (32-bit) to support more than 3.5 GB of RAM” and the answer is type the command prompt “bcdedit /set [{ID}] pae ForceEnable”.

    But, probably the question is worthy to be rephrased how to enable and be able to use more than 3.5 (or 3.25) GB of RAM on W7 32 bits system.

    I tried PAE in 2 different Desktop mainboards with identical systems: Intel® Desktop Board D945GNT with a Intel® Pentium® D Processor 3.4GHZ and 3.00GB usable Ram, and Intel® Desktop Board DG41WV with Intel® E7500 2.93GHZ and 3.25GB usable Ram. Both 64 bits capable and 4GB Ram.

    The 2 systems enabled PAE; then, using the procedure indicated in http://www.jensscheffler.de/using-gavotte-ramdisk-in-windows-7 I installed Gavotte Ram disk and recovered 16MB Ram (nothing) on the first system, but recovered the entire 775MB unused for the second one.

    So, in the Ram disk of the second system, I assigned a movable pagesys file to it, from 16MB to 700MB, and a movable pagesys of 16MB to 3300MB on a partition of a different physical disk of the system.

    I proved 2 facts: 1. The systems preferred the Ram swap file over the one in the hard disk. I saw it moving, growing and shrinking. 2. Benchmark with PC Pitstop (image attached in http://www.pablomolina.net/bench700.png) shows great improvement in system disk speed, and the system runs quite faster. In the bench I compared a 700 MB page file in the Ram disk with a 700MB page file in another partition of the same system drive.!

    You need to set the system to clean page file at shutdown with Microsoft kb/314834 procedure.

    For me, PAE makes sense on a 32 bit system, and works. I won´t go for the 64 bits system as I use Windows professionally and accumulated 450 programs over years, which will take me months to reinstall.

  • magicandre1981

    If you don't want to a patch files, you can use a boot loader. This Bootloader can be installed on the current system or an an USB pen drive. So you can easily test it without effecting your system.

    enter image description here