This is a free preview of a paid episode. To hear more, visit blog.codingconfessions.com
This is a short aside in our virtual memory series. We have talked extensively about the size of a virtual address and the virtual address space, but we haven’t yet looked at the size of a physical address.
As you might expect, physical addresses on x86-64 are smaller than 64 bits. But they are also not necessarily the same size as virtual addresses. In this video, we look at how big physical addresses are, how you can check this on your own machine, and why different processors may expose different physical address sizes.
If you haven’t read the virtual memory article, do check it out. You can also download the ebook as a PDF from the link below.
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
I wanted to make a small aside or a bonus video as part of our virtual memory series so in this video I want to talk about the size of the physical address so in one of the earlier videos and even in the article I have talked about the size of the virtual address and size of the virtual address space but what we have not discussed is what is the size of the physical address itself so this video should
SPEAKER_00cover that so just to recap on x86 64-bit architecture we have a 64-bit wide register so that means any address that you store it has to fit into those registers so as a result all addresses are Usually 64-bit white, I mean, they have to be stored in the same 64-bit white registers. But not all 64-bits are used. So for virtual addresses,
only 48 bits are used on the current x86 64 architecture.
SPEAKER_00If you are using a 4-level page table. If you use 5-level page table, I think 57 bits are used. So that depends on the architecture and how many levels of page tables you are using. Similarly, you don't use all the 64 bits for physical address. So again, that is architecture dependent. So the x86 architecture documents that a physical address can go up to maximum of 52 bits. But that is the maximum, what the architecture says.
SPEAKER_00But in reality, it varies. So every processor model can have a smaller Physical Address Size so it is implementation specific so different processor generations have different physical address sizes so as an example if you want to check on your own machine The size of the physical address, this is how you can do it. If you have a Linux machine, you can run this command. So cat slash proc slash cpu info and grep core address.
SPEAKER_00And it will list for each CPU what is the size of the physical address. So here you can see on my laptop, every CPU has 39 bits of physical address and 48 bits of virtual address. so 39 bits of physical address gives me a maximum of 512 GB of physical address space so if I could install 512 GB of RAM my laptop could use it but again my laptop doesn't have that much physical capacity to have 512 GB
of RAM so my
SPEAKER_00It only has two BMMM slots, so I can only install two RAM sticks and they can only be maximum of 64 GB. So, even though the processor allows 512 GB of addressable memory,
This is a free preview of a paid episode. To hear more, visit blog.codingconfessions.com In the last video, we learned about copy-on-write (CoW) and understood its mechanics by digging inside the mmap pathway in the...
This is a free preview of a paid episode. To hear more, visit blog.codingconfessions.com In the last video, we discussed demand paging. Now, let’s move towards an even more interesting topic: copy-on-write (CoW). Just...
This is a free preview of a paid episode. To hear more, visit blog.codingconfessions.com In the previous video in our virtual memory series, we discussed demand paging. But that was mostly theoretical, explaining how...
This is a free preview of a paid episode. To hear more, visit blog.codingconfessions.com Welcome back to the video series on virtual memory based on my article on the same topic. It is also available in ebook format on...
This is a free preview of a paid episode. To hear more, visit blog.codingconfessions.com This is the 5th video in our virtual memory series. In the previous video, we learned about the page table and how the hardware...