For example, suppose that only 2 frames of real memory were available, but the working set is 3 pages. Then the program would frequently reference data and instructions out of 3 pages. But at any given point, only two pages would be in memory, since that is all it can hold. When the third page is referenced, it has to be copied in from the swap area and the program can proceed. But then the page that was in the selected victim frame is now gone. Since that page will be referenced again soon, the operating system will have to bring in that page again. It is even worse if the memory is being modified, because the old dirty page must be write back to disk, making the time penalty even worse. |