I have started to learn about Virtual Address Space (VAS) and I have few questions:
- How much of VAS is created for each process depending on the architecture (32-bit and 64-bit)?
- Is VAS for each process created on hard disk? If so, what happens if there is not enough space?
- What is the difference between VAS and Virtual Memory (VM)?
For n-bit OS, these n-address lines allow address space upto 2n addresses, i.e., 0 to 2n - 1. This would mean 16 EiB for 64-bit OS. (Though in actual implementations, less space is used as this much space is unnecessary.)
For example, in C++, program memory is divided in stack, heap, data, code. I'm not sure if analogy is correct (may be), but it somewhat presents an insight if you're aware.
If you know about computer architecture (which I'm sure you do from the question), it'd be clarified by now. Still, for anyone in general, I'm giving a bit of explanation.
Thus, to access a memory data, Virtual Addresses are specified by user/program to OS, which are converted to Physical Addresses by memory management unit (mmu) and then applied to the address lines of the computer architecture (electronics spotted!!), which yields the data at the corresponding physical location. And this concept is called Virtual Memory.
-Himanshu