what is the maximum amount of memory for a single process in UNIX and Linux and windows? how to calculate that? How much user address space and kernel address space for 4 GB of RAM?
How much user address space and kernel address space for 4 GB of RAM?
The address space of a process is divided into two parts,
User space: On standard 32 bit x86_64 architecture,the maximum addressable memory is 4GB
, out of which addresses from 0x00000000
to 0xbfffffff
= (3GB)
meant for code, data segments. This region can be addressed when user process executing either in user or kernel mode.
Kernel space: Similarly, addresses from 0xc0000000
to 0xffffffff
= (1GB)
are meant for virtual address space of the kernel and can only addressed when the process executes in kernel mode.
This particular address space split on x86
is determined by the value of PAGE_OFFSET
. Referring to Linux 3.11.1v
page_32_types.h and page_64_types.h, page offset is defined as below,
#define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
Where Kconfig defines a default value of default 0xC0000000
also with other address split options available.
Similarly for 64 bit,
#define __PAGE_OFFSET _AC(0xffff880000000000, UL)
.
On 64 bit architecture 3G
/1G
split doesn't hold anymore due to huge address space. As per the source latest Linux version has given above offset as offset.
When I see my 64 bit x86_64 architecture, a 32 bit process can have entire 4GB
of user address space and kernel will hold address range above 4GB
. Interestingly on modern 64 bit x86_64 CPU's not all address lines are enabled(or the address bus is not large enough) to provide us 2^64
= 16 exabytes
of virtual address space. Perhaps AMD64
/x86
architectures has 48
/42
lower bits enabled respectively resulting to 2^48
= 256TB
/ 2^42
= 4TB
of address space. Now this definitely improves performance with large amount of RAM, at the same time question arises how it is efficiently managed with the OS limitations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With