Presentation is loading. Please wait.

Presentation is loading. Please wait.

TUTORIAL MEMORY MANAGEMENT (Best-Fit & First-Fit).

Similar presentations


Presentation on theme: "TUTORIAL MEMORY MANAGEMENT (Best-Fit & First-Fit)."— Presentation transcript:

1 TUTORIAL MEMORY MANAGEMENT (Best-Fit & First-Fit)

2 Q UESTION 1 Assume that the main memory has the following 5 fixed partitions with the following sizes: 100KB, 500KB, 200KB, 300KB and 600KB (in order) a) How would each of the First-fit and Best-fit algorithms place processes of 212KB, 417KB, 112KB and 426KB (in order)? b) Compute the total memory size that is not used for each algorithm. c) Which algorithm makes the efficient use of the memory?

3 A NSWER 1 a) Partition SizeFirst-FitFragmentation 100K 500KP1(212K) =288K 200KP3(112K) =88K 300K 600KP2(417K) =183K Partition SizeBest-FitFragmentation 100K 500KP2(417K) =83K 200KP3(112K) =88K 300KP1(212K) =88K 600KP4(426K) =174K

4 A NSWER 1 b) Total Fragmentation First-fit: Total Fixed Partitions – Total Process First-fit Size =959 Total Fragmentation Best-fit: Total Fixed Partitions – Total Process Best-fit Size =533

5 A NSWER 1 c) Memeory Utilization Ratio: i. First-fit = 741 / 1700 = 43.5% ii. Best-fit = 1167 / 1700 = 68.6% *Best-fit has the most efficient use of the memory

6 Q UESTION 2 In a variable partition memory management, assume memory is allocated as specified in a diagram below: Suppose the request for memory is as follows: 18K, 12K, 7K Redraw the diagram to show how memory would look after all requests has been allocated by using the following memory allocation strategies: a)First-fit b)Best- fit HoleUsed 10K20K10K 20K30K10K30K5K20K 15K K 11 HoleUsed 10K20K10K 20K30K10K30K5K20K 15K

7 A NSWER 2 a) FIRST-FIT: 18K will be allocated at the first hole of size 30K 12K will be allocated at the first hole of size 12K 7K will be allocated at the first hole of size 10K

8 A NSWER 2 b)BEST-FIT: 18K will be allocated at the first hole of size 20K 12K will be allocated at the first hole of size 15K 7K will be allocated at the first hole of size 20K


Download ppt "TUTORIAL MEMORY MANAGEMENT (Best-Fit & First-Fit)."

Similar presentations


Ads by Google