Perhaps the most important benefit of VM is this: the ability to define protections on virtual memory and have them honored by the OS.
Unix and friends (including Linux), allow four protection or permission values on memory pages:
|Protection or permission type||Meaning|
|None||No permission to do anything on the page|
|Read||Page can be read from|
|Write||Page can be written to|
|Execute||Page (code) can be executed|
Let's consider a small example: we allocate four pages of memory in our process (numbered 0 to 3). By default, the default permission or protections on the pages is RW (Read-Write), which means the pages can be both read from and written to.