Memory Management
Storage Types:
1. Real storage
2. Virtual storage
Main memory primary memory real memory
Main storage primary storage real storage
Programs or data must be in main storage in order to be
run or referenced directly.
It has Less Capacity & it is Costly as compared to
secondary storage.
Secondary storage disks, tape cartridges etc.
Has More Capacity,
Less Costly as compared to primary storage
Storage Organization Issues:
Storage organization means the manner/style/method in
which the primary memory is viewed. The following
schemes are implemented in various computer systems:
Should there be a single task or should there be more
than one task at the same time?
If several tasks are present, do we give them equal
amount of space or do we put them into portions (called
partitions) of different sizes?
1
If partitioned, do these partitions remain of same size or
are they dynamic (called dynamic partitioning – so as to
allow to adapt according to the changes in the needs of
tasks)?
Are there any fixed portions for certain specific tasks
(i.e. according to their type) or do we fit them anywhere
according to their size?
Should a task be fitted into a contiguous (i.e.
neighboring) block of storage locations (e.g. our class
rooms) or can a task be parceled up into separate blocks
and placed in any available slots in the memory?
Storage Management:
Storage Management strategies determine how a particular
storage organization performs under various policies, e.g.
When do we get a new program to place in the memory?
(Time is the deciding factor here.)
Does it depends upon the system’s request or do we seek
to anticipate the system’s requests?
Where should the task be placed in the memory that is
about to run?
Do we prefer memory space utilization or do we prefer
efficient execution time? (Consideration?)
If the memory is already full & a new task is to be placed
in it, which already present programs should be taken out
to make space.
On what basis this displacement should take place
o Should we replace the oldest program(s)? (oldest
w.r.t. time)
2
o Should we replace those that are least frequently
used?
o Should we replace those that are least recently
used?
Storage Hierarchy:
Primary storage Secondary storage (already defined)
Cache storage high speed storage
Much faster than the other two (thus it speeds up
execution time)
Much expensive than the other two
Therefore, smaller caches are used due to cost
Programs in the main memory are shuttled to the
cache first before being executed. (although it seems
like a overhead, but the performance gain due to
superior execution time is greater than the overhead)
Storage Management Strategies:
Storage Management Strategies are divided as follows:
1. Fetch Strategies: are concerned with when to obtain
the next piece of program or data for transfer to main
memory from secondary memory.
a). Demand fetch strategies: the next piece of program
or data is brought into the main storage when it is
referenced by a running program.
b). Anticipatory fetch strategies: the next piece of
program or data is brought into the main storage by
3
making careful guesses and anticipating about the
future of the program control.
2. Placement strategies: are concerned with determining
where in main storage to place an incoming program.
Examples are first fit, best fit & worst fit.
3. Replacement strategies: are concerned with
determining which piece of program or data to
displace to make room for incoming tasks.