Attached my lab for week4. It’s an online course so there aren’t very good instructions week by week. I really want to learn this without missing my turn in date so it would be nice to have an answer key to go over. I haven’t started this lab yet, I’m asking for the result as a precaution. Thank you for your time!
Week 4: Memory Management: Main Memory – iLab
Print This Page |
Connect to the iLab here
|
Lab 4 of 7: Main Memory Allocation – Part 1 of 2 (50 Points)
Submit your assignment to the Dropbox located on the silver tab at the top of this page. See Syllabus/”Due Dates for Assignments & Exams” for due date information. |
L A B A C C E S S |
Accessing Your Lab |
To access your labs after you’ve logged in, apply the following steps:
· Click the Professional Development tab located on the top of the page.
· Select “Development Paths.”
You will see the course that you are taking listed on this page.
· Click the course to see the labs.
Starting Your Lab |
There are two ways to start a lab activity:
· Schedule it. (Recommended)
Because you have access to live equipment, there is only a defined number of students who can use any one lab at any given time. It is recommended to schedule your labs to make sure the lab is available to you at your convenience. If you try to log into a lab and the access is denied, the system will let you schedule the lab at a later date.
· Start it right away.
L A B O V E R V I E W |
Scenario/Summary |
Main Memory Allocation – Part 1 of 2
The objective of this week’s lab is to simulate and evaluate different memory allocation/deallocation techniques (first fit, next fit, best fit, and worst fit)when a linked list is used to keep track of memory usage. You will implement a separate Memory component for TWO of the four memory allocation/deallocation techniques. This lab is designed to be completed in two weeks. One allocation/deallocation technique is due on Week 4, and the second technique is due on Week 5.
Assume that the memory is 256 KB and is divided into units of 2 KB each. A process may request between 3 and 10 units of memory. Your simulation consists of three components: a Memorycomponent that implements a specific allocation/deallocation technique, a request generation component that generates allocation/deallocation requests, and a statistics reporting component that prints out the relevant statistics. The Memory component exports the following functions:
1. int allocate_mem(int process_id, int num_units): allocates num_units units of memory to a process whose id is process_id. If successful, it returns the number of nodes traversed in the linked list. Otherwise, it returns -1.
2. int deallocate_mem(int process_id): deallocates the memory allocated to the process whose ID is process_id. It returns 1, if successful, otherwise “1.
3. int fragment_count( ): returns the number of holes (fragments of sizes 1 or 2 units).
The request generation component generates allocation and deallocation requests. For allocation requests, the component specifies the process ID of the process for which memory is requested as well as the number of memory units being requested. For this simulation, assume that memory is requested for each process only once. For deallocation requests, the component specifies the process ID of the process whose memory has to be deallocated. For this simulation, assume that the entire memory allocated to a process is deallocated on a deallocation request. You may generate these requests based on some specific criteria, e.g., at random or from a memory allocation/deallocation trace obtained from some source.
There are three performance parameters that your simulation should calculate for the chosen two techniques: average number of external fragments, average allocation time in terms of the average number of nodes traversed in allocation, and the percentage of times an allocation request is denied.
Generate 10,000 requests using the request generation component, and for each request, invoke the appropriate function of the Memory component for each of the memory allocation/deallocation techniques. After every request, update the three performance parameters for each of the techniques. The statistics reporting component prints the value of the three parameters for the two techniques at the end.
Deliverables |
You will submit four separate files to the dropbox for Week 4:
1. C or C++ program (source code)
2. Executable file (object)
3. Instructions to execute the program
4. Analysis of the results for the chosen allocation/deallocation technique
L A B S T E P S |
Main Memory Allocation – Technique 1 (50 points) |
The program for the main memory allocation/deallocation for the first chosen technique is due this week. This program is to be written in C or C++ programming language on a Linux environment. Thesecond technique is due on Week 5.
IMPORTANT: Please make sure that any questions or clarification about these labs are addressed early.