Upload
myrajendra
View
489
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
1
• Multiple partition allocation
Storage Management
3
Recap
In the last class, you have learnt:
Single partition allocation
Hard ware support for relocation and limit
register
4
Objectives
On completion of this class, you will be able to
know
Multiple partition allocation
Allocation of memory
5
Multiple Partition Allocation
Job scheduling
• Must take into account who wants to run, the memory
needs, and partition availability
• This is a combination of short / medium term scheduling
Sequence of events:
• In an empty memory slot, load a program
• It can compete for CPU time
• Upon job completion, the partition becomes available
6
Multiple Partition Allocation
Hole
Block of available memory;
Holes of various size are scattered throughout
memory
Dynamic storage
When a process arrives, it is allocated memory
from a hole large enough to accommodate it
7
Multiple Partition Allocation
• Operating system maintains information about:
• allocated partitions ( holes )
• free partitions ( holes )
• Operating System maintains a table of this
memory
• Space is allocated based on this table
• Adjacent free spaces merged to get largest holes
Multiple Partition Allocation
• Consider an example consisting of 5 processes
from P1 to P5
• These process occupy some space in memory
and corresponding burst times for their execution
as shown in the table in next slide
• Sequence of allocation of these multiple
processes in to the memory capacity of 2160K are
shown in the next slide 8
Multiple Partition AllocationJob queue
Process Memory Time
P1 600 K 10
P2 1000 K 5
P3 300 K 20
P4 700 K 8
P5 500 K 15
9
0 K
400 k
2560 k
OS
2160 K
OS
P1
P2
P3
0 K
400 k
1000 k
2000 k
2300 k
2560 k
P2 Terminates
Allocate P4 P1 TerminatesP5 Allocated
OS
P1
P2
P3
0 K
400 k
1000 k
2000 k
2300 k
2560 k
P1
OS
P4
1700 k
P3
0 K
400 k
1000 k
2000 k
2300 k
2560 k
OS
P4
P3
1700 k
0 K
400 k
1000 k
2000 k
2300 k
2560 k
OS
P4
P3
P5
900 k1000 k
1700 k
0 K
400 k
2000 k
2300 k
2560 k
Indicates a Hole
10
Memory Allocation
How to allocate memory to a new process?
First fit
- Allocate the first hole that's big enough
–Search can start at the beginning
–Creates average size holes
Best fit
-Allocate smallest hole that's big enough
–Must search entire list, unless ordered by size
–Produces the smallest leftover hole which cannot be
used
11
Memory Allocation
• Worst fit
– Allocate largest hole
– Must search the entire list, unless sorted by size
– Gets rid of large holes making it difficult to run large
programs
• First-fit and best-fit better than worst-fit in terms
of speed and storage utilization
12
Summary
In this class, you have learnt
Multiple Partition Allocation
• Operating system maintains information about:
– Allocated partitions ( holes )
– Free partitions ( holes )
• Operating System maintains a table of this memory
Allocation of Memory
First Fit
Best Fit
Worst Fit
13
Frequently Asked Questions
1. Explain about Multiple Partition Allocation
2. Explain how to allocate memory to a new
process
14
Quiz
1. Allocate the first hole that's big enough
a) First fit
b) Best fit
c) Worst fit
d) None
15
2. Allocate smallest hole that's big enough
a) First fit
b) Best fit
c) Worst fit
d) None
Quiz
16
Quiz
3. Allocate largest hole
a) First fit
b) Best fit
c) Worst fit
d) None
Other subject materials
• Web designing
• Micro processors
• C++ tutorials
• java
home
18
Quiz
4. Block of available memory
a) Hole
b) Byte
c) Word
d) None