0
How exactly a process uses virtual address space?
I have read that every process works on it's own Private address space where it assumes it has been allocated the whole of primary block.How exactly do the mapping from logical to primary address happen?
1 Antwort
0
This is handled by the operating systems' page file system. When an application is started it is assigned a block of memory, a pid, a priority flag, etc. This information all goes to the page file.
Addressing your question (no pun intended), the operating system knows the starting address of the program (0xABC123) but the program itself doesn't care where it resides in physical memory as it will assume a "virtual" starting address of 0x0.
.NET actually allows you to ping the Windows OS to get page file information and increase is allotted size, assign a different priority, etc. I believe g++ also allows the same functionality from a Linux OS, where the file system is AKA the swap partition.
Edit: something didn't sit right with me in my answer. The process doesn't really assume a starting address 0x0 - in "dumbing" down my answer that statement could be misleading.