18
1 Multiple partition allocation Storage Management

35. multiplepartitionallocation

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: 35. multiplepartitionallocation

1

• Multiple partition allocation

Storage Management

Page 2: 35. multiplepartitionallocation

2

HOME PREVIOUS TOPIC NEXTPREVIOUS QUESTION PAPERS FOR OSCPP TUTORIALS

Page 3: 35. multiplepartitionallocation

3

Recap

In the last class, you have learnt:

Single partition allocation

Hard ware support for relocation and limit

register

Page 4: 35. multiplepartitionallocation

4

Objectives

On completion of this class, you will be able to

know

Multiple partition allocation

Allocation of memory

Page 5: 35. multiplepartitionallocation

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

Page 6: 35. multiplepartitionallocation

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

Page 7: 35. multiplepartitionallocation

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

Page 8: 35. multiplepartitionallocation

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

Page 9: 35. multiplepartitionallocation

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

Page 10: 35. multiplepartitionallocation

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 

Page 11: 35. multiplepartitionallocation

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

Page 12: 35. multiplepartitionallocation

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

Page 13: 35. multiplepartitionallocation

13

Frequently Asked Questions

1. Explain about Multiple Partition Allocation

2. Explain how to allocate memory to a new

process

Page 14: 35. multiplepartitionallocation

14

Quiz

1. Allocate the first hole that's big enough

a) First fit

b) Best fit

c) Worst fit

d) None

Page 15: 35. multiplepartitionallocation

15

2. Allocate smallest hole that's big enough

a) First fit

b) Best fit

c) Worst fit

d) None

Quiz

Page 16: 35. multiplepartitionallocation

16

Quiz

3. Allocate largest hole

a) First fit

b) Best fit

c) Worst fit

d) None

Page 17: 35. multiplepartitionallocation

Other subject materials

• Web designing

• Micro processors

• C++ tutorials

• java

home

Page 18: 35. multiplepartitionallocation

18

Quiz

4. Block of available memory

a) Hole

b) Byte

c) Word

d) None