# What is the maximum amount of ram a 64bit machine can theoretically address?

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?!

-

## migrated from stackoverflow.comNov 3 '09 at 19:31

This question came from our site for professional and enthusiast programmers.

Note that no existing x86 64-bit processor can actually do this. Their caches don't have enough tag bits, their address buses don't have enough width, and so on. 46-bits (8TB) is the maximum for many modern x86 CPUs. – David Schwartz Jan 31 '13 at 2:40
Theoretically, there is no limit. Even 32-bit CPUs can have an address space above 4 GiB. It depends on how the memory management system is implemented in hardware, which is usually independent of the CPU's word length. Pointers in programs are always word-length, but these are virtual addresses anyways (and not physical), so they are further mapped into a different address space. – Breakthrough Apr 22 '13 at 19:04
This is an old question with old answers but I feel like the most upvoted answers to this question are very misleading, and they are answers to How much RAM could a machine with 64-bit wide address bus address. As David and Breakthrough pointed out above, the "bitness" of an architecture reflects the size of the primary registers, not the size of the address bus. – Sebi Aug 27 '15 at 5:06

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

-

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....

-

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

-
Too small.... today!!!! – snicker Nov 3 '09 at 20:32
16.777216 million tebibyte. If you want to be precise. – totymedli Feb 5 '14 at 0:05
I read in other sources that a processor cannot use every bit to access memory, is this being considered in your answer? – Andrey Jun 23 '14 at 14:20

Most of today's current processors have some sort of artificial limit on their address size. For example, the AMD64 architecture has a 52-bit limit on physical memory and currently only supports a 48-bit virtual address space. (Via Wikipedia). However yes, physically ~16.4 million terabytes is possible.

-

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.

-
Of course since current CPUs have this address space artificially limited, it may only be a decade before there aren't enough bits to address every byte on a disk any more. Hopefully by that stage the limits will have been raised, as the way SSDs are going, making an entire disk appear as a section of memory could improve performance dramatically. I wouldn't mind plugging an SSD into a RAM slot instead of into a SATA cable! – Malvineous Dec 21 '14 at 3:18
@Malvineous I was talking about something more fundamental, even if you limit yourself to 63 bits you can directly address 9223372 TB. And SSDs in a RAM slot already exist, see Sandisk. – Mark Ransom Dec 21 '14 at 4:16
I wasn't disagreeing with you, I was just pointing out that with current technology there are artificial limits on what you are suggesting (e.g. only 48 or 51 bits of the address brought out to the physical bus). If those DIMM-SSDs catch on we might run out of memory addresses sooner than you suggest, unless these artificial limits can be raised or removed. I agree if the full 64-bits were available then it would be decades before it becomes a problem. – Malvineous Dec 21 '14 at 10:57
Just for the record I looked at the SanDisk UlltraDIMM link but sadly this isn't technically SSD-as-RAM. It's a 6Gbps SATA SSD, with a DDR3-to-SATA adapter allowing it to be accessed as if it's memory. The additional conversion of memory requests into the SATA protocol introduce some latency and seem a bit messy. Hopefully someone will see the benefit of this and soon release a true memory interface to flash without any unnecessary adapters in between! – Malvineous Dec 21 '14 at 20:44

Would be also good to note that the operating system has its own limitation about memory in a 64-bit architecture.

For example, see what wikipedia sais about Windows Vista 64:

All 64-bit versions of Microsoft operating systems currently impose a 16 TB limit on address space. Processes created on the 64-bit editions of Windows Vista can have 8 TB in virtual memory for user processes and 8 TB for kernel processes to create a virtual memory of 16 TB.[29] In terms of physical memory Windows Vista 64-Bit Basic supports up to 8 GB of RAM, Windows Vista 64-Bit Home Premium supports up to 16 GB of RAM, and Windows Vista 64-Bit Business/Enterprise/Ultimate supports up to 128 GB of RAM.[8]

-
Up-to-date details for Windows: msdn.microsoft.com/en-us/library/windows/desktop/aa366778.aspx – Arjan Jul 28 '14 at 21:53

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.

-
Too big. Why are you laying them flat? You can get it all in a 100' cube. You'll probably need liquid nitrogen to keep it cool, though! – Loren Pechtel Nov 28 '13 at 20:37
the amount of nitrogen gas that would boil to would pose a safety risk to the great people of Seattle – Conrad.Dean Feb 5 '14 at 2:46

There is no particular fixed relationship between the bit size of a processor and the amount of addressable memory. Most 8-bit machines of the late 1970s could easily access 65,536 bytes directly, the 16-bit 8088 and 8086 could access 1,048,576 bytes directly. Additionally, it's possible to add hardware to allow machines to access any quantity of RAM indirectly; many machines with 8-bit processors had 128K or more, and memory-expansion units for 8088-based PCs could access over 16 megs. Although Microsoft only enabled such feature in "server" versions of Windows, it was possible for 32-bit code to access memory beyond the 4GiB mark using similar approaches.

-

for a realistic physical answer 1536gb with 48 ram cards runing 32gb single sticks and 4x lga2011 xeons

this is for the esayist pc someone can buy without breaching hidden hardcore severs think theres 64gb single stics brings to.... 3072gb 128gb be 6144gb 256gb be 12288gb

just to throw out there that theres ways to get around os limitations with ram if ur os can only see 4gb ram turn the leftover into a ram drive and use the ram drive as page file XD XD XD XD just a matter of making a preboot os system some such simular thing was done back in early days of dos/windows 3.11 etc

and there can be other little hacks for getting around cpu limitations

gear we can see isnt wats out there theres way more potent stuff i had a pc from 98 runing 8 proccessors and somethink like 32gb ram but this is expensive hi end servers

im looking into servers as desktops because im sick of the computers for the public XD

-