• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Virtual Memory for Linux Processes

chrstrbrts

Senior member
Hello,

If my text is correct, for a running 64-bit Linux process the virtual memory starts at 0x40000000 with nothing lying between 0x00000000 and 0x3fffffff.

This is over 1 billion wasted bytes.

Why?

Thanks.
 
Actually, I just realized that the wasted bytes are virtual and would not take up any page frames in physical memory.

But still, why have your process start at some other place other than 0?
 
Pretty sure its 0x00400000. 32 bit anyway. Not sure about 64.

That's 4 MB from 0.

At the very least 0x00000000-0x00000fff isn't used in order to catch null pointers by convention.

Why 4 MB though? Guessing it has to do with avoiding overlap with any legacy memory space or V86 mode and other issues of backward compatibility and conventions.

And 4 MB = exactly 1 entire page table which is simply one entry in the page table directory.

It's all arbitrary really.

With 64 bit address space it doesn't really matter, we are talking bigger than number of stars in the galaxy (universe?) type numbers.
 
Last edited:
If my text is correct, for a running 64-bit Linux process the virtual memory starts at 0x40000000 with nothing lying between 0x00000000 and 0x3fffffff.

It's a 47-bit virtual address space. Also note that if the binary is compiled as a PIE (position independent executable) that address and the address of all libraries (which are PIC) will be randomized.

You can reserve TB's of address space without using any actual RAM if it's not committed. I don't know if you care about Windows but before 8.1 this was not possible because of how it worked and the 44-bit size limit[1]. This limitation was removed in 8.1 (partially because of CFG)[2].

[1] http://www.alex-ionescu.com/?p=50
[2] http://www.alex-ionescu.com/?p=246
 
Last edited:
Back
Top