Virtual Memory: Locality Workbench



Simulations of program behavior show that during process time, a program will exhibit phases (periods of little change in the contents of main memory) alternating with transitions (periods of significant change in the contents of main memory). During phases the system has extended periods of time with relatively few page faults. However, a higher concentration of page faults occurs during transitions, creating considerable cost to the system. Phase/transition behavior is studied in order to create programs that spend more time in the phase states and less time in the transitions.

The principle of locality states that during phases of execution, a program requires a small subset of virtual pages. The set of pages used during a phase is the "locality set" of that phase.

This workbench illustrates several patterns of program behavior. The patterns are represented by buttons on the left side of the workbench. When you press the button for a pattern, a phase diagram and sample code for that pattern are revealed. They are matched with a reference string exhibited below them. The phase diagrams are created with a certain rationale in mind. Press the button "Rationale" to find out what it is. Compare the phase diagrams with the cost of transitions in mind. How would you make these programs more efficient?

Workbench