L2-Memory_Management_part_1
L2-Memory_Management_part_1
OPERATING SYSTEMS
Chapter 2:
Memory Management:
Early Systems
LEARNING OBJECTIVES
After completing this chapter, you should be able to describe:
▪ The basic functionality of the three memory allocation schemes
presented in this chapter: fixed partitions, dynamic partitions,
relocatable dynamic partitions
▪ Best-fit memory allocation as well as first-fit memory allocation
schemes
▪ How a memory list keeps track of available memory
▪ The importance of
deallocation of memory in a
dynamic partition system
▪ The importance of the
bounds register in memory
allocation schemes
▪ The role of compaction and
how it improves memory
allocation efficiency
3 3
INTRODUCTION
▪ Management of main memory is critical
▪ Entire system performance dependent on two condition;
▪ How much memory is available
▪ Optimization of memory during job processing
▪ Permits multiprogramming
▪ Partition sizes remain static
▪ Must shut down computer system to reconfigure
▪ Requires:
▪ Protection of the job’s memory space
▪ Matching job size with partition size
▪ Disadvantages
▪ Full memory utilization only during loading of first jobs
▪ Subsequent allocation: memory waste
▪ External fragmentation: fragments between blocks
14
BEST-FIT VERSUS FIRST-FIT ALLOCATION
▪ Two methods for free space allocation
▪ First-fit memory allocation: first partition fitting the requirements
▪ Leads to fast allocation of memory space
▪ Best-fit memory allocation: smallest partition fitting the
requirements
▪ Results in least wasted space
▪ Internal fragmentation reduced, but not eliminated
▪ A request for a block of 200 spaces has just been given to the Memory
Manager.
▪ Using First-Fit Algorithm, Memory Manager locate the first block that are
enough to accommodate the job. Now pointing at 6785.
▪ Loaded to location 6795 add 200 spaces
▪ Now the free spaces starts from 6985 with only size of 400.
21
BEST-FIT VERSUS FIRST-FIT ALLOCATION
(CONT'D.)
▪ Algorithm for best-fit
▪ Goal
▪ Find the smallest memory block into which the job will fit
▪ Entire table searched before allocation