caching and blocking another justification for the memory-access equality assumption is that operating system designers have developed general mechanisms that allow most memory accesses to be fast these mechanisms are based on two important locality-ofreference properties that most software possessestemporal localityif program accesses certain memory locationthen there is increased likelihood that it accesses that same location again in the near future for exampleit is common to use the value of counter variable in several different expressionsincluding one to increment the counter' value in facta common adage among computer architects is that program spends percent of its time in percent of its code spatial localityif program accesses certain memory locationthen there is increased likelihood that it soon accesses other locations that are near this one for examplea program using an array may be likely to access the locations of this array in sequential or near-sequential manner computer scientists and engineers have performed extensive software profiling experiments to justify the claim that most software possesses both of these kinds of locality of reference for examplea nested for loop used to repeatedly scan through an array will exhibit both kinds of locality temporal and spatial localities havein turngiven rise to two fundamental design choices for multilevel computer memory systems (which are present in the interface between cache memory and internal memoryand also in the interface between internal memory and external memorythe first design choice is called virtual memory this concept consists of providing an address space as large as the capacity of the secondary-level memoryand of transferring data located in the secondary level into the primary levelwhen they are addressed virtual memory does not limit the programmer to the constraint of the internal memory size the concept of bringing data into primary memory is called cachingand it is motivated by temporal locality by bringing data into primary memorywe are hoping that it will be accessed again soonand we will be able to respond quickly to all the requests for this data that come in the near future the second design choice is motivated by spatial locality specificallyif data stored at secondary-level memory location is accessedthen we bring into primary-level memory large block of contiguous locations that include the location (see figure this concept is known as blockingand it is motivated by the expectation that other secondary-level memory locations close to will soon be accessed in the interface between cache memory and internal memorysuch blocks are often called cache linesand in the interface between internal memory and external memorysuch blocks are often called pages