When process A has run long enough and the scheduler decides to run process B, will all the pages of process A be moved to the disk or they remain in the main memory?
A page is a part of RAM memory. It will never move to the disk, unless one of two happen:
- The program specifically asked to store the memory in the disk (obviously, the memory will move to the disk)
- There isn't enough RAM to store all of the memory of all processes combined. In this case, some processes' memory will be transferred to a designated area. When that process will need to run, it will be transferred back and once again memory of some other program will be placed there, if needed.