Operating System: Case Study 5

There are two methods for free space allocation. First-fit memory allocation leads to fast allocation of memory space because first partition fitting the requirement. In the first loading of jobs, Job 1 which contains 100k that will search in the memory blocks to be allocated. Since Job 1 with 100k with 3 turnarounds can not be accommodate with Block 1 because of insufficient memory size. By that Job 1 will search again in the table of memory blocks. Job 1 found out that Block 2 with 200k is available for accommodation. So now, Job 1 is in Block 2. Job 2 with 10k with 1 turnaround searches for available block. Since first-fit allocation makes fitting its requirement, Job 2 will be accommodated by Block 1 with 50k. Job 3 with 3k and 2 turnaround will search in the memory blocks and found out that Block 3 with 70k is ready for accommodation. Job 4, will do the same thing, Block 4 is ready for accommodation so Job 4 is settled in Block 4. However, Job 5 is too
large with 23k with 2 turnaround is not suitable for the poor size of Block 5 with 15k only. So, Job 5 is in waiting/queue area. Same scenario with Job 5, the remaining Jobs of Job 6, Job 7, Job 8, Job 9 and Job 10 will be in the waiting/queue area.
In the first loading of jobs, Job 1 in the Block 2 and Job 3 in the Block 3 has 2 and 1 more turnaround respectively have not yet finished there stay in their memory block they are in. Only Job 2 in Block 1 and Job 4 in Block 4 are freed in the first unloading of loads.
In the next loading, Job 1 in the Block 2 has another second turnaround and Job 3 in the Block 3 has another last turnaround. Block 1 with 50k can now be loaded by Job 5 with 23 k and 2 turnaround for it was newly freed by Job 2. Job 6 with 6k with 1 turnaround will search for available memory block and Block 4 with 11k is ready for accommodation. Block 5 with 15k is empty for Job 7 with 25k is too large for it. In the third loading, Job 1 in the Block 1 is still there for its last turnaround Block 3 is a newly freed block and now accommodating Job 7 with 25k and 1 turnaround. Job 5 is also there for its last turnaround. Job 8 with 55k and 2 turnarounds is now searching for an available block of memory ready for accommodation and found out Block 8. Still, Block 5 is empty for Job 9 is too large.
In the third unloading of loads, Job 1 in the Block 2 and Job 5 in the Block 1 is now newly freed and also for Job 7 in the Block 3. Not yet for Job 8 in the Block 4 for Job 8 has its last turnaround in the next loading.
In the fourth loading, still Job 8 resides in the Block 4. Block 1, Block 2, Block 3 and Block 5 are now newly freed. Job 9 with 88k and 3 turnaround is now searching for a newly freed block of memory; Block 2 with 200k of size is available and will stay for 1 turnaround. And now the empty block of memories are Block 1, Block 3 and Block 5.
In the unloading, Job 8 resides in Block 4 will now leave for it just finished its turnaround. Job 9 in the Block 2 will also still be for it has 2 more turnaround.
In the fifth loading, Job 9 is in the Block 2 with its second turnaround. The last job which is Job 10 will find a block of memory. Job 10 with 100k and 3 turnaround searched Block 4. Block 1, Block 3 and Block 5 are empty for no more incoming jobs to be executed. In the unloading process, no jobs are to be released or to be unloaded for the have more turnaround left. In the second-to-the last loading, Job 9 in the Block 2 for its last turnaround and Job 10 reside in Block 4 in its second turnaround. In its unloading time, Job 9 resides in Block 2 is soon to be freed for its last turnaround. Block 4 with Job 10 with its second turnaround and freed by the next loading.The last loading, only Job 10 is active in the system in the memory block of Block 4 and the rest of the blocks are empty. Unloading of jobs for Block 4 will now release Job 10 and soon to be freed.
The second method for free space allocation is Best-fit allocation scheme for its smallest partition fitting the requirements. In the same situation of jobs and block in the best-fit allocation will goes like this. Since best-fit introduced internal fragmentation. In the execution of jobs, Job 1 with 100k and 3 turnaround searches in table of memory block from Block 1 to Block 5 and look of the least wasted memory or commonly called as internal fragmentation. So now Job 1 found the least memory waste or the internal fragmentation from Block 4 with 115k of 15k. Next to it is Job 2 start to search for the memory block that can fit with the least internal fragmentation and discovered a 5k of it in the memory block of Block 5. Job 3 effortless searches another available memory block, and it luckily fitted to Block 1 with 15k of internal fragmentation. Also, Job 4 did the same thing, searches and found out Block 1 for it has a 35k internal fragmentation.
However, Block 1 is already allocated to Job 3. In this scenario, Job 4 will be redirect to Block 3 with 55k of internal fragmentation. The only available block is Block 2 that can cater Job 5 with 177k of integral fragmentation since there is no longer memory block available but only block 2. The rest of the Jobs are all in the waiting/queue area. The first loading of Jobs where Block 1 which stored Job 3 and left 1 turnaround, Block 2 with Job 5 and left another turnaround, while in the Block 3 which accommodate Job 4 and Block 3 which accommodate Job 2 will be soon be freed. However, Job 1 in the Block 4 contains 2 turnarounds left for it to be freed. In unloading event, Job 4 in the Block 3 and Job 2 in the Block 5 is now finished. Next loading of Jobs which is the last loading of Job 3 and Job 5 in Block 1 and Block 2 respectively. Job 7 chose Block 7 for its small wasted memory of 45k and same goes with Job 6 chose Block 5. In unloading, Block 1 and Block 2 will now be freed by Job 3 and Job 5 for its last turnaround and same goes with Job 7 and Job 6. While Job 1 in the Block 4 will have there last turnaround in the next loading of jobs. Another loading of jobs is Jobs 9 and Job 8 will now searches for a memory block to accommodate them and found that Block 2 and Block 3 respectively. Still Job 1 is in the Block 4 for its last turnaround in that memory block and soon to be freed. And now on its unloading of jobs, Job 1 is finally finished in the memory Block 4. Block 4 is a newly freed memory block. In the fourth loading, Job 9 in the Block 2 will have its second turnaround in that block and Job 8 in the Block 3 will have its last turnaround. However, Job 10 is now ready for accommodation for the available memory block. Since Block 4 is a newly freed block, it can now cater Job 10 and have its first turnaround out of 3. Job 8 will now be finished for its last loading in the memory block of 3.
Then, the next loading of jobs of Job 9 will be sooner being freed and Job 10 in the Block 4 has its stay for the second turnaround. Unloading Job9 from Block 2 is the second-to-the-last unloading jobs.
Finally, Job 10 at Block 4 will stay for the last turnaround and sooner be finished and all the memory will be back as empty.
One of the Hypothetical allocation schemes which allocates largest free available block to new job. Furthermore, it is the opposite of best-fit. In the execution of jobs, Job 1 with look and 3 turnarounds will search in the table of memory blocks and find the largest free available blocks. Job 1 will have the option in the Block 2 for it will have a 100k of free available memory block. Job 2 will do the same as what Job 1 did, Job 2 can be accommodated by Block 4 for its 105k since it can't be in Block 2 with 190k because of Job 1 is occupying memory block of Block 2. Job 3 finds a free and available memory block for it to perform its jobs and searches Block 3 with a 35k of free available block. Repeatedly, Job 4 searches for a memory block and that is Block 1 with 35k. And the only available memory block is Block 5, but Block 5 is not suitable for Job 5 for its poor memory block size. So Job 5 and the rest of the Jobs are in the waiting/queue area. In the first loading of jobs, Block 1 will have Job 4, Block 2 will have Job 1 with its first turnaround, Block 3 will have Job 3 with its first turnaround, and Block 4 will have Job 2. In the first unloading, Block 1 is a newly freed memory block because Job 4 is only having a turnaround and the same thing with Block 4 with a job of Job 2.
In the second loading oe jobs, Block 1 has a new job of Job 6 because Job 1 is finished. Block 2 with Job 1 has its second turnaround and Block 2 with Job 3 has its last turnaround in the memory block. Block 4 is also a newly freed memory block and now accommodating Job 5 with a turnaround of 2. Unloading the jobs of Job 6 in the Block 1 and Job 3 in Block 3 in this round turnaround of 2. Unloading the jobs of Job 6 in this round.
Another loading of jobs, Block 1 and Block 5 is now a newly freed memory block and now accepting a new job. However, Job 7 is not appropriately-sized to Block 1. So now, Block 3 is an suitable memory for Job 7. In the unloading of event, all jobs are being newly freed memory block for there last turnaround.
Next loading of jobs, Job 8 and Job 9 are now searching for all the table of memory block for them to accommodate their existence. Job 8 found Block 2 and Job 9 found Block 4 for residence. In the fifth loading of jobs, it still has Job 8 and Job 9 in the memory block of Block 2 and Block 4 respectively. Job 8 has the last turnaround and Job 9 has the second turnaround.
In the another loading of jobs, Block 2 is now a newly freed memory block and now catering the last job which is Job 10 with a 100k of available size. Job 9 is still residing in the memory block of Block 4 and it is the last job of its turnaround.
And lastly, Job 10 is finished after the eight loads of jobs and by that time all the memory block are empty.

Comments

Popular posts from this blog

Assignment 5

Assignment 7