1 / 8

TUTORIAL

TUTORIAL. MEMORY MANAGEMENT (Best-Fit & First-Fit). Question 1. Assume that the main memory has the following 5 fixed partitions with the following sizes: 100KB, 500KB , 200KB, 300KB and 600KB (in order )

delila
Download Presentation

TUTORIAL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. Answer 1 a)

  4. Answer 1 b) Total Fragmentation First-fit: Total Fixed Partitions – Total Process First-fit Size 1700-741 =959 Total Fragmentation Best-fit: Total Fixed Partitions – Total Process Best-fit Size 1700-1167 =533

  5. Answer 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. 1 2 3 4 5 6 7 8 9 12K 11 12 10K 10K 10K 10K 20K 20K 30K 30K 10K 10K 5K 5K 30K 30K 20K 20K 10K 10K 15K 15K 20K 20K 20K 20K Hole Hole Used Used Question 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

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

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

More Related