Under variable partition storage management, the main storage free areas arranged incrementally by address are: 10KB, 4KB, 20KB, 18KB, 7KB, 9KB, 12KB, and 15KB. For the following continuous storage requests: 12KB, 10KB, 15KB, 18KB, ask: using the first fit algorithm, the best adaptation algorithm, Which idle area will be used ?
Answer
(1) First fit algorithm:
Free zone queue is: 10KB , 4KB , 20KB , 18KB , 7KB , 9KB , 12KB , 15KB
First allocate:
Allocate 12KB jobs: find free zone of first conform is 20KB, segmentation this free zone, this job use 12KB, Remaining free zone 8KB.
Free zone end queue of assignment is:
10KB | 4KB | 8KB | 18KB | 7KB | 9KB | 12KB |15KB
| -- | -- | -- | -- | -- | -- | -- | -- | -- |
Second allocate:
Allocate 10KB jobs: find free zone of first conform is 10KB, is completely assigned.
Free zone end queue of assignment is:
4KB | 8KB | 18KB | 7KB | 9KB | 12KB | 15KB
| -- | -- | -- | -- | -- | -- | -- |
The third allocate:
Allocate 15KB jobs: find free zone of first conform is 18KB, segmentation this free zone, this job use 15KB, Remaining free zone 3KB.
Free zone end queue of assignment is:
The fourth allocate:
Allocate 18KB jobs: can't find free zone of Greater than 18KB, so this job allocate failed.
(2) Best fit algorithm:
Free zone queue is:
First allocate:
Allocate 12KB jobs: find free zone of first conform is 12KB, is completely assigned.
Free zone end queue of assignment is:
Second allocate:
Allocate 10KB jobs: find free zone of first conform is 10KB, is completely assigned.
Free zone end queue of assignment is:
4KB | 7KB | 9KB | 15KB | 18KB | 20KB
| -- | -- | -- | -- | -- | -- | -- | -- |
The third allocate:
Allocate 15KB jobs: find free zone of first conform is 15KB, is completely assigned.
Free zone end queue of assignment is:
The fourth allocate:
Allocate 18KB jobs: find free zone of first conform is 18KB, is completely assigned.
Free zone end queue of assignment is:
4KB | 7KB | 9KB | 20KB
| -- | -- | -- | --
---
(3) Worse fit algorithm:
Free zone queue is:
First allocate:
Allocate 12KB jobs: find free zone of first conform is 20KB, segmentation this free zone, this job use 12KB, Remaining free zone 8KB.
Free zone end queue of assignment is:
Second allocate:
Allocate 10KB jobs: find free zone of first conform is 18KB, is completely assigned.
Free zone end queue of assignment is:
The third allocate:
Allocate 15KB jobs: find free zone of first conform is 15KB, segmentation this free zone, this job use 15KB, Remaining free zone 3KB.
Free zone end queue of assignment is:
The fourth allocate:
Allocate 18KB jobs: can't find free zone of Greater than 18KB, so this job allocate failed.
如有侵权,请联系作者删除