operating systems - memory management
TRANSCRIPT
![Page 1: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/1.jpg)
Damian Gordon
![Page 2: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/2.jpg)
![Page 3: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/3.jpg)
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
![Page 4: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/4.jpg)
![Page 5: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/5.jpg)
![Page 6: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/6.jpg)
![Page 7: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/7.jpg)
![Page 8: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/8.jpg)
![Page 9: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/9.jpg)
![Page 10: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/10.jpg)
![Page 11: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/11.jpg)
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
![Page 12: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/12.jpg)
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
101
Approximate number of clock cycles to access the various elements of the memory hierarchy.
![Page 13: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/13.jpg)
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
101
103
Approximate number of clock cycles to access the various elements of the memory hierarchy.
![Page 14: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/14.jpg)
HARD DISK
(MAIN
MEMORY)
(SECONDARY
MEMORY)
2
CACHE 1
101
103
107
Approximate number of clock cycles to access the various elements of the memory hierarchy.
![Page 15: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/15.jpg)
Let’s consider an operating system model with a single user, and how they use memory.
![Page 16: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/16.jpg)
MAINMEMORY
![Page 17: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/17.jpg)
200Kavailable
MAINMEMORY
![Page 18: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/18.jpg)
If I create a program:
200Kavailable
MAINMEMORY
![Page 19: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/19.jpg)
If I create a program:
PROGRAM 1
200Kavailable
MAINMEMORY
![Page 20: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/20.jpg)
If I create a program:
to be processed, it has
to be writen entirely into
Main Memory, in
contiguous space
PROGRAM 1
200Kavailable
MAINMEMORY
![Page 21: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/21.jpg)
PROGRAM 1
200Kavailable
MAINMEMORY
![Page 22: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/22.jpg)
If the program is bigger:
PROGRAM 1
200Kavailable
MAINMEMORY
![Page 23: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/23.jpg)
If it doesn’t fit in the
memory, it’s can’t be
processed.
200Kavailable
MAINMEMORY
![Page 24: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/24.jpg)
This is the limitation of all computers, if a program is too big, we have to do one of two things:
1. Get more memory
2. Make the program smaller
![Page 25: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/25.jpg)
Store first location of program in the base register
(for memory protection);
Set Program Counter to the first memory location;
Read first instruction of program;
WHILE (last instruction reached OR Program Counter is
greater than Memory Size)
DO Increment the Program Counter;
IF (last instruction reached)
THEN Stop Loading Program;
END IF;
IF (Program Counter is greater than Memory Size)
THEN Stop Loading Program;
END IF;
Load instruction into memory;
Read next instruction of program;
END WHILE;
![Page 26: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/26.jpg)
To allow more than one program to run at the same time, the memory is subdivided into FIXED PARTITIONS.
![Page 27: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/27.jpg)
MAINMEMORY
250K
![Page 28: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/28.jpg)
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
250K
100K
25K
25K
50K
50K
![Page 29: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/29.jpg)
This leaves us with less memory, but at least more than one user (and their user process) can be logged into the system at the same time.
If we want to adjust the size of the partitions we need to shut down the system, go into the boot login, and then restart.
![Page 30: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/30.jpg)
WHILE (there are still jobs in the queue)
DO Determine the job’s requested memory size;
IF Job size > Size of Largest Partition
THEN Reject the Job;
PRINT “Job Rejected: Not Enough Memory”;
Exit; /* this iteration and get next job */
END IF;
MyCounter := 1;
WHILE (MyCounter <= Number of Partitions in Memory)
DO IF (Job Size > Memory_Partition[Counter].Size
THEN MyCounter := MyCounter + 1;
ELSE IF (Memory_Partition[Counter].Status == “FREE”;
THEN Load job into Memory_Partition[Counter];
Memory_Partition[Counter].Status := “BUSY”;
Exit; /* this iteration and get next job */
ELSE MyCounter := MyCounter + 1;
END IF;
END WHILE;
No partition available;
put job in waiting queue;
END WHILE;
![Page 31: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/31.jpg)
To make this work, the Memory manager needs to keep a Partition Table to remember the status of all the partitions.
![Page 32: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/32.jpg)
To make this work, the Memory manager needs to keep a Partition Table to remember the status of all the partitions.
Partition Number
Partition Size
MemoryAddress Access
PartitionStatus
1 100K 200K Job1 BUSY
2 25K 300K Job4 BUSY
3 25K 325K FREE
4 50K 350K Job2 BUSY
5 50K 400K FREE
![Page 33: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/33.jpg)
Which looks like this in memory:
![Page 34: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/34.jpg)
Which looks like this in memory:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
250K
100K
25K
25K
50K
50K
![Page 35: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/35.jpg)
Let’s add some jobs in:
![Page 36: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/36.jpg)
Let’s add some jobs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
250K
![Page 37: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/37.jpg)
Let’s add some jobs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
250K
![Page 38: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/38.jpg)
Let’s add some jobs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2250K
![Page 39: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/39.jpg)
Let’s add some jobs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2250K
PROGRAM 3
![Page 40: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/40.jpg)
Let’s add some jobs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
INTERNAL FRAGMENTATION
![Page 41: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/41.jpg)
Let’s add some jobs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
INTERNAL FRAGMENTATION
INTERNAL FRAGMENTATION
![Page 42: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/42.jpg)
Let’s add some jobs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
INTERNAL FRAGMENTATION
INTERNAL FRAGMENTATION
EMPTY PARTITION
![Page 43: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/43.jpg)
Let’s add some jobs in:
PARTITION 1
PARTITION 2
PARTITION 3
PARTITION 4
PARTITION 5
100K
25K
25K
50K
50K
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
INTERNAL FRAGMENTATION
INTERNAL FRAGMENTATION
EMPTY PARTITION
EMPTY PARTITION
![Page 44: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/44.jpg)
Selecting the correct set of partition sizes is a tricky business, too small and larger jobs will be waiting forever to run, too big and there is a lot of wasted space.
![Page 45: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/45.jpg)
An alternative is DYNAMIC PARTITIONS, where a job is given the space it requests, if there is space available for it.
This takes care of lots of problems.
![Page 46: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/46.jpg)
Let’s add some jobs in:
MAINMEMORY
250K
![Page 47: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/47.jpg)
Let’s add some jobs in:
MAINMEMORY
250K
PROGRAM 1
![Page 48: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/48.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
250K
![Page 49: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/49.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
250K
![Page 50: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/50.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
250K
![Page 51: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/51.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
PROGRAM 3
250K
![Page 52: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/52.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
PROGRAM 3250K
![Page 53: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/53.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
PROGRAM 3250KPROGRAM 4
![Page 54: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/54.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
PROGRAM 3250K
PROGRAM 4
![Page 55: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/55.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
![Page 56: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/56.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
![Page 57: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/57.jpg)
It isn’t perfect, because the next program will go into the slot that is freed up by a completed job.
![Page 58: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/58.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
![Page 59: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/59.jpg)
Let’s add some jobs in:
MAINMEMORY
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
![Page 60: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/60.jpg)
Let’s add some jobs in: PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
![Page 61: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/61.jpg)
Let’s add some jobs in: PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
![Page 62: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/62.jpg)
Let’s add some jobs in: PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
EXTERNAL FRAGMENTATION
![Page 63: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/63.jpg)
So however we partition, we end up with fragmentation, one way or the other.
![Page 64: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/64.jpg)
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
PROGRAM 3
![Page 65: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/65.jpg)
PROGRAM 1
PROGRAM 2
250K
PROGRAM 4
PROGRAM 5
So how do we decide where to slot in a new job?
PROGRAM 3
![Page 66: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/66.jpg)
So how do we decide where to slot in a new job?
PROGRAM 1
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
![Page 67: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/67.jpg)
Here is the first slot free
PROGRAM 1
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
![Page 68: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/68.jpg)
Here is the first slot free
PROGRAM 1
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
![Page 69: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/69.jpg)
But here’s a better fitPROGRAM 1
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
![Page 70: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/70.jpg)
But here’s a better fitPROGRAM 1
PROGRAM 2
PROGRAM 3 250K
PROGRAM 4
PROGRAM 5
PROGRAM 6
![Page 71: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/71.jpg)
So we can either add the new block to the first available slot (FIRST-FIT ALGORITHM) or we can add the new block to the most suitable available slot (BEST-FIT ALGORITHM).
![Page 72: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/72.jpg)
If the Memory Manager wants a FIRST-FIT ALGORITHM then it stores a table in order of memory locations.
If the Memory Manager wants a BEST-FIT ALGORITHM then it stores a table in order of size of memory locations.
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
315 40 FREE
250 50 FREE
300 15 BUSY
355 25 BUSY
315 40 BUSY
Starts Size Status
![Page 73: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/73.jpg)
After a job is completed, there are three cases for deallocating space in memory:
![Page 74: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/74.jpg)
1. There are jobs either side of the freed space:
PROGRAM 3
PROGRAM 4
PROGRAM 6
PROGRAM 3
PROGRAM 4
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
![Page 75: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/75.jpg)
2. There are is a job on one side, and it’s free on the other side of the freed space:
PROGRAM 3
PROGRAM 6
PROGRAM 3
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
![Page 76: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/76.jpg)
3. There are no jobs on either side of the freed space:
PROGRAM 6
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
![Page 77: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/77.jpg)
Let’s look at the implications of each of these cases in terms of what the Memory Manager has to do to remember the FREE and BUSY memory spaces.
![Page 78: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/78.jpg)
1. There are jobs either side of the freed space:
PROGRAM 3
PROGRAM 4
PROGRAM 6
PROGRAM 3
PROGRAM 4
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
![Page 79: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/79.jpg)
1. There are jobs either side of the freed space:
PROGRAM 3
PROGRAM 4
PROGRAM 6
PROGRAM 3
PROGRAM 4
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
250-300
315-340
300-315
200-250
355-380
340-355
250-300
315-340
300-315
200-250
355-380
340-355
![Page 80: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/80.jpg)
1. There are jobs either side of the freed space:
250-300
315-340
300-315
200-250
355-380
340-355
250-300
315-340
300-315
200-250
355-380
340-355
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 BUSY
315 25 BUSY
340 15 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 FREE
315 25 BUSY
340 15 FREE
355 25 BUSY
![Page 81: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/81.jpg)
2. There are is a job on one side, and it’s free on the other side of the freed space:
PROGRAM 3
PROGRAM 6
PROGRAM 3
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
![Page 82: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/82.jpg)
2. There are is a job on one side, and it’s free on the other side of the freed space:
PROGRAM 3
PROGRAM 6
PROGRAM 3
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
250-300
300-315
200-250
355-380
315-355
250-300
200-250
355-380
300-355
![Page 83: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/83.jpg)
2. There are is a job on one side, and it’s free on the other side of the freed space:
250-300
300-315
200-250
355-380
315-355
250-300
200-250
355-380
300-355
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 FREE
315 40 FREE
355 25 BUSY
![Page 84: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/84.jpg)
2. There are is a job on one side, and it’s free on the other side of the freed space:
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 FREE
315 40 FREE
355 25 BUSY
![Page 85: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/85.jpg)
2. There are is a job on one side, and it’s free on the other side of the freed space:
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 15 FREE
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 BUSY
300 55 FREE
355 25 BUSY
![Page 86: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/86.jpg)
3. There are no jobs on either side of the freed space:
PROGRAM 6
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
![Page 87: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/87.jpg)
3. There are no jobs on either side of the freed space:
PROGRAM 6
PROGRAM 5 PROGRAM 5
PROGRAM 8 PROGRAM 8
250-300
300-315
200-250
355-380
315-355
250-355
200-250
355-380
![Page 88: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/88.jpg)
3. There are no jobs on either side of the freed space:
250-300
300-315
200-250
355-380
315-355
250-355
200-250
355-380
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 FREE
315 40 FREE
355 25 BUSY
![Page 89: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/89.jpg)
3. There are no jobs on either side of the freed space:
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 FREE
315 40 FREE
355 25 BUSY
![Page 90: Operating Systems - Memory Management](https://reader034.vdocument.in/reader034/viewer/2022052700/55a587cc1a28ab31768b45ce/html5/thumbnails/90.jpg)
3. There are no jobs on either side of the freed space:
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 BUSY
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 50 FREE
300 15 FREE
315 40 FREE
355 25 BUSY
Starts Size Status
200 50 BUSY
250 105 FREE
355 25 BUSY