OS Concept related to MM
OS Concept related to MM
https://www.youtube.com/c/ComputerScienceAcademy7
A typical memory map for single user computer :
• The operating system like MS-DOS is single user operating system.
• It is also a single tasking system.
• The command interpreter of such operating system is invoked
Free when the computer is started.
Memory
• This operating system loads the program into memory and
Process assigns as much memory as possible.
Command
• It then sets the instruction pointer and executes the program.
Interpreter • If the program is terminated, it is removed from memory.
Kernel • The memory map for single user computer, consist of kernel,
command interpreter, the program to be executed and free
Fig. Memory map of single
user computer available memory.
• Kernel of operating system provides basic operating system
services while command interpreter interprets operating system
commands.
Partitioning
• Certain operating system uses partitioned memory management method, to
allow multiprogramming.
1. Fixed partitioning
• Partitioning means dividing main memory into various sections, these sections
are called partitions.
• These partitions could be of different sizes, but once decided they could not be
changed.
• Hence these partitions are called Fixed partitions.
• These partitions can be allocated to process by operating system.
• For example, a memory of 32 K words might be divided into regions of the
following sizes.
1. Fixed partitioning
• For example, a memory of 32 K words might be divided into regions of the
following sizes.
Resident monitor 10 K • As jobs enter the system, they are put in job
Monitor 10 K
queue.
Very small jobs Small Jobs up
4K to 4 K • The job scheduler takes into account the memory
Average jobs 6K Average Jobs requirement of each job and available regions in
up to 6 K
determining which jobs are allocated memory.
Large jobs 12 K Large Jobs up
to 12 K
• When job is allocated space, it is loaded into
region. It can then compete for CPU.
• When a job terminates, it releases its memory
Job 1 : 3 K
region, which a job scheduler may fill with
Job 2 : 4.5 K
Job 3 : 9.8 K
another job from the job queue.
• The fixed partition suffers from the problem of
X
Job 4 : 1.2 K
internal fragmentation (i.e. wastage of memory
space within partition).
• It also limits the degree of multiprogramming and
CPU utilization.
2. Variable partitioning
• The fixed partition suffers from the problem of internal fragmentation
(i.e. wastage of memory space within partition).
• It also limits the degree of multiprogramming and CPU utilization.
• Variable partitions overcomes these problems.
• In variable partitions the number of partitions and their sizes are
variable.
• They are not defined at the time of system generation.
• At any given time, any partition can be free or allocated to some process.
• In variable partition the starting address of any partition is not fixed.
0 0 0 0
Monitor Monitor Monitor Monitor
(40 K) (40 K) (40 K) (40 K)
40 k 40 k 40 k 40 k
Job 1
Job 1 Job 1 Job 1 Terminates Free
Memory
(60 K) (60 K) (60 K) (60 k)
100 k 100 k Allocate 100 k 100 k
Job 2 Job 4 (70 k) Job 4 Job 4
Job 2 Terminates Free (70 K) (70 K)
Memory
(100 K) (100 k) 170 K 170 K
Free (30 k) Free (30 k)
200 k 200 k 200 k 200 k
Job 3 Job 3 Job 3 Job 3
(30 K) (30 K) (30 K) (30 K)
230 k 230 k 230 k 230 k
Free Free Free Free
Memory Memory Memory Memory
256 K (26 k) 256 K (26 k) 256 K (26 k) 256 K (26 k)
RAM 4 GB
OS App 1 App 2
(1.2 GB) (3 MB) (60 MB)