Professional Documents
Culture Documents
O
C
A
L
I
Analysis of aLet theirnumber
large be a typical
of computer program has
typical program T
with lots of loops and subroutine calls
shown that references to memory at any given Y
encountered frequently. When loop is
interval of time tendthe
executed, toCPU
be confined
repeatedlywithin a set
refers to few OF
localized areas in memory.
of instructions This phenomenon
in memory that constitutesis R
known as thetheproperty LOCALITY
loop. Everyoftime OF
a subroutine is REFERENCE
called,
E
Its set of instructions are fetched from
the memory. thus loops and subroutines F
tend to localize the reference to the memory. E
R
E
N
C
E
Let's- take a look at the following pseudo-code to see
why locality of reference works
•Random Replacement:
Chooses one tag-data item for replacement at
random.