Programming Question

Description

In this project, you will use what you have studied in the chapter Memory Management & Operating Systems to emulate how operating systems manage memory paging, allocation, deallocation and replacement. Upon completion of this project you will be able to:

Don't use plagiarized sources. Get Your Custom Assignment on
Programming Question
From as Little as $13/Page

Describe how operating systems manage memory
Use simple codes to emulate basic functionalities of operating systems
Prompt

1) Show the memory state for the different scenarios in the tables below and analyze which choice is the best. Discuss the impact that Linux versus Windows might have on the ending memory state.

2) With that information in mind, run the following list of jobs:

An interval is the number of seconds
Total Memory size = 20 Kbyte
Page size = 1 Kbyte
Job ID Start Time Job required size Execution interval Job state at the end of the interval
1 1 2 7 End
2 2 3 8 Sleep
3 3 4 6 End
4 4 3 6 Sleep
5 5 2 9 Sleep
6 6 3 6 Sleep
7 7 2 6 Sleep

3) Run three different scenarios in order to manage memory allocation

Run the program for the following scenarios:

Best-Fit
First-Fit
Worst-Fit

Each should be run for the following jobs:

Job ID Start Time Job required size Execution interval Job state at the end of the interval
8 8 3 4 Sleep
9 9 5 5 Sleep
10 10 2 8 Sleep
11 11 4 6 End
12 12 6 5 Sleep
2 13 3 6 End
4 13 3 4 Sleep
13 13 5 3 End
7 13 2 3 End
9 17 4 4 Sleep
10 19 2 11 End
6 19 3 6 End
5 20 2 10 Sleep
4 21 3 12 Sleep
12 22 6 13 End
8 22 3 9 End
9 28 5 11 End
5 33 2 3 Sleep
4 34 3 10 End
5 38 2 10 End
Prompt Tips

Here are a couple tips for getting started with the assignment:

You’ll want to write a program that will simulate the process an operating system follows when cycling jobs to make sure they are all completed quickly. C++ is a language that works well, but you can choose the language you prefer.
Copy the data in the two tables from the prompt into a text file that you can use as input for a program.
Write a program using Java, C++, Python, or the programming language of your choice that can take the input from your text file.
In the same program, write a function that will queue up each job along with its start time, job size, execution interval, and state at the end of each interval.
Continue building on this program so that you can execute each of these jobs according to their individual interval.
Have this program return the state of each job at the end of each interval.
Run the program until all jobs are complete.

You will need to use what you learned about allocation, deallocation, and replacement to build this program, and you’ll need to consider the total memory size and page size defined in the prompt. When asked to consider different scenarios, it means to consider running these jobs using the best-fit allocation scheme, the first-fit scheme, or others, and then determine which would be best.

Grading Rubric

Your project will be graded based on the following rubric:

Category Unacceptable (0-1) Needs Improvement (2-3) Good (4) Excellent (5) Total Possible Points
Efficiency of solutions (x2) Solutions require long unnecessary waiting times for the processes and not using the complete memory space Solutions either require long unnecessary waiting times for the processes or not using the complete memory space Solutions are making acceptable use of memory on both temporal and spatial levels Solutions lead to an optimal temporal and spatial use of memory 10
Analysis (x2) Not able to explain choices or results Basic understanding of memory management but needs to be improved on the analysis level Adequate explanation and analysis for memory state scenario choice Clear explanation and clarification of the choices for scenarios and results 10
Trying different scenarios (x1) No Scenarios tested Only one scenario is tested Tests of only 2 different scenarios Tests of 3 different scenarios 5
Use of functions for each memory management task (x1) No use of any of the three function types (allocation, deallocation and replacement) Use of only one of the three function types (allocation, deallocation and replacement) Use of only two of the three function types (allocation, deallocation and replacement) Use of all function types for allocation, deallocation and replacement 5
Correct matching between the chosen scenario and functions (x1) Chosen methods do not match the planned scenario Some of the chosen methods match the planned scenario Majority of the chosen methods match the planned scenario All chosen methods match the planned scenario 5
Completeness and correctness of the test case (x1) Less than half the timing and memory spatial constraints of the assignment (task starting times, sizes and intervals) where implemented More than half the timing and memory spatial constraints of the assignment (task starting times, sizes and intervals) where followed Most of the timing and memory spatial constraints of the assignment (task starting times, sizes and intervals) where followed All the timing and memory spatial constraints of the assignment (task starting times, sizes and intervals) where fully followed 5