Professional Documents
Culture Documents
Ankur Gupta
Agenda
Wasted Memory
Time Complexity
Memory-access overhead
Single process monitor
Simplest form of memory management.
Memory divided into 2 partitions – one for 0 Operating System
the OS and one for the user process.
OS simply needs to keep track of the first (monitor)
and last memory location to allocate
memory for transient processes.
If a process whose size is more than the
Transient Process Area is attempted to be
loaded, the OS throws an error preventing
such an operation
Protection of OS code from user programs
requires hardware assistance – fence
register which contains the highest
address occupied by the OS Code.
Addresses generated by user programs
need to be higher than the address in the Transient Process Area
fence register. Otherwise the process is
aborted.
Other approach is to use protection bits
with each memory location and not to
allow tampering of a memory location MAX
whose memory bit is protected
Static Memory Partitioning
Algos for searching the free list include – First Fit, Best Fit,
Worst Fit and choice of these depends on trade-off between
speed and wastage of memory.
Algo for partition deletion goes like this
For each outgoing process P
- locate the PDT entry using P’s PCB – PDT[PCB[P]]
- If P is being swapped out, copy its runtime image from
its partition to the swap file.
- update the PCB by removing the partition reference
- add the partition to the free list and try and add it to
neighboring free areas to reduce fragmentation.
- remove the partition entry from PDT.