64bit Maximum Memory

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
kubeos
Member
Member
Posts: 138
Joined: Tue Jan 30, 2007 2:31 pm
Location: Kamloops BC, CANADA
Contact:

64bit Maximum Memory

Post by kubeos »

...so I was checking out wikipedia.

32-bit gives you 4gb memory access.
64-bit gives you 16 exabytes

But according to the wiki most systems only use up to 48-bit addressing. So what does that give you? I think it's around 281terabytes.. am I right? Or did I mess up my math.

[edit]
My scientific calculator give 281 terabytes
Windows calculator gives me 288 terabytes
[/edit]
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: 64bit Maximum Memory

Post by Solar »

Erm... how do you calculate that?

2^48 = 281,474,976,710,656 bytes
= 274,877,906,944 KiB
= 268,435,456 MiB
= 262,144 GiB
= 256 TiB

The rest, I guess, are confusions of 2^x (Tebibyte, factor 1024) with 10^x (Terabyte, factor 1000)...

See Terabyte.
Every good solution is obvious once you've found it.
kubeos
Member
Member
Posts: 138
Joined: Tue Jan 30, 2007 2:31 pm
Location: Kamloops BC, CANADA
Contact:

Re: 64bit Maximum Memory

Post by kubeos »

ahh.. i didn't factor in the 1024 thing.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: 64bit Maximum Memory

Post by Brendan »

Hi,
kubeos wrote:But according to the wiki most systems only use up to 48-bit addressing.
Most (all?) 64-bit 80x86 Intel CPUs only support 36-bit physical addressing (even though some of the earlier CPUs incorrectly report support for 48-bit physical addressing via. CPUID). The architectural maximum is 52-bit physical addressing. I don't think any CPU supports this (yet).

Also note that for AMD CPUs the "up to 52-bit physical addressing" is also supported in protected mode if you use PAE, so that (in theory) a 32-bit OS would be able to access (almost) 4096 TiB of RAM. I'm not sure if Intel have (or will?) do the same for PAE (if they don't, then PAE would still be limited to 36-bit addressing even if the CPU itself supports more). I'd assume Intel would also support "up to 52-bit physical addressing" with PAE (there's no reason not to), but assumptions suck.

For linear addressing, AFAIK all 64-bit CPUs support 48-bit linear addressing, which is also the (current) architectural limit. CPU manufacturers would need to add a fifth level to the paging structures (e.g. a "PML5") or create entirely different paging structures to allow more than 48-bit linear addressing.

When CPU manufacturers do increase the linear address space size (you know it'll happen eventually), OS developers would need update their linear memory management code, but the change would be entirely transparent to applications (in a well designed OS).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: 64bit Maximum Memory

Post by AJ »

Brendan wrote:When CPU manufacturers do increase the linear address space size (you know it'll happen eventually), OS developers would need update their linear memory management code, but the change would be entirely transparent to applications (in a well designed OS).
I was just thinking about this. In a well designed 64 bit kernel, it seems to me like the kernel should not even have to be changed to support the larger linear address code (I haven't actually tested this and may well be wrong!).

If you use canonical addresses (which you have to anyway) and your kernel is right at the top of virtual RAM, surely you can assign process address spaces dynamically depending on the particular values reported by CPUID?

Cheers,
Adam
Post Reply