3 Pages
The total address-space is divided into individual pages. Pages can be many different sizes; generally they are around 4 KiB, but this is not a hard and fast rule and they can be much larger but generally not any smaller. The page is the smallest unit of memory that the operating system and hardware can deal with.
Additionally, each page has a number of attributes set by the operating system. Generally, these include read, write and execute permissions for the current page. For example, the operating system can generally mark the code pages of a process with an executable flag and the processor can choose to not execute any code from pages without this bit set.
Programmers may at this point be thinking that they can
easily allocate small amounts of memory, much smaller than 4
KiB, using malloc
or similar
calls. This heap memory is actually backed
by page-size allocations, which the
malloc
implementation divides
up and manages for you in an efficient manner.