In virtual memory, can two different processes have the same address?

Viewed 26533

This is an interview question I found in a website, the questions says: "In virtual memory, can two different processes have the same address? When you answer "No" which is correct, how one process can access another process' memory, for example the debugger can access the variables and change them while debugging?"

What I understand is :

  1. 2 diff process can have same virtual memory address. This is because each process has its own page table. Each process thinks it as 4Gb memory on a 32-bit machine. So both P1 and P2 can access address 0xabcdef - but the physical memory location might be different. Isnt this right ?

  2. The debugger works on the same principle - 2 processes can access the same address. So it can modify variables etc on the fly.

5 Answers
Related