L05
L05
Lecture No. 5
Contents
1 Motivation
7 LOGO
7
1
1/8/23
Motivation
8 LOGO
8
Motivation
v Let us consider a file of records (fixed length or variable
length)
2
1/8/23
Reclaiming
Spaces in Files
10 LOGO
10
11 LOGO
11
3
1/8/23
12 LOGO
12
4
1/8/23
14 LOGO
14
v RRN can not be used, but exact byte offset must be used
5
1/8/23
16 LOGO
16
1. First-Fit Strategy
17 LOGO
17
6
1/8/23
v Example:
§ AVAIL LIST: size=10,size=22,size=50,size=60
§ record to be added: size=20
§ Which record from AVAIL LIST is used for the new record?
18 LOGO
18
v Example:
§ AVAIL LIST: size=60,size=50,size=22,size=10
§ record to be added: size=20
§ Which record from AVAIL LIST is used for the new record?
19 LOGO
19
7
1/8/23
v Internal Fragmentation
§ wasted space within a record.
v External Fragmentation
§ space is available at AVAIL LIST, but it is so small that cannot be
reused.
20 LOGO
20
Study This !
v For each of the following approaches, which type of
fragmentation arises, and which placement strategy is more
suitable?
v When the added record is smaller than the item taken from
AVAIL LIST:
8
1/8/23
Fragmentation in
Physical Storage
22 LOGO
22
23 LOGO
23
9
1/8/23
24 LOGO
24
25 LOGO
25
10
1/8/23
26 LOGO
26
27 LOGO
27
11
1/8/23
28 LOGO
28
29 LOGO
29
12