35. multiplepartitionallocation

2,065 views 18 slides Jan 17, 2013
Slide 1
Slide 1 of 18
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18

About This Presentation

No description available for this slideshow.


Slide Content

1

•Multiple partition allocation
Storage Management

2
HOME PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS

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 Allocation
Job queue
ProcessMemoryTime
P1 600 K 10
P2 1000 K5
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 Terminates
P5 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 k
1000 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
Tags