Call us 24/7: + 1(925)399 0085

Get your paper done by an expert

No matter what kind of academic paper you need, it is simple and secure to hire an essay writer for a price you can afford at StudyAcer. Save more time for yourself.

WhatsApp + 1(925)399 0085
$ 10
free
  • bibliography
  • title page
  • revisions
per page
19 k happy customers
4.7 out of 5 satisfaction rate
27 writers active

Main Memory Allocation The objective of this week’s lab is to simulate allocation/deallocation of memory. Assume that the memory is 256…

Main Memory Allocation

The objective of this week’s lab is to simulate allocation/deallocation of memory. Assume that the memory is 256 KB and is divided into units of 1 KB each. A process may request between 3 and 10 units of memory.

For each process you need to save the process id, the process’ allocated location in memory, the number of memory units allocated to the process, and memory used in Byte. The location is the first memory unit allocated to that process. User will specify the number of memory units and memory used is the number of memory units times the size of each unit which in this case is 1 KB. 
 

Allocation/deallocation technique for this lab:

For allocation, the user specifies the process id of the process for which memory is requested as well as the number of memory units being requested. Start location for each process is the first free memory unit coming right after the last allocated memory unit. So processes follow each other in memory without any hole between processes. The first process starts from memory unit 0. Let’s assume the user requests to allocate 5 memory units to this process. Then memory locations 0-4 get allocated to this process and the next process’ allocation should start from memory unit 5.

For deallocation, the user 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. Then all the following processes in memory should move upwards (shifted up) as many memory units as the deallocated process had. This avoids creating any hole in the memory as the deallocated memory is effectively reoccupied by the following processes.


Command Menu:

Your program starts with a menu consisting of these commands (prompt the user to select from the menu):

A)   Allocate the specified number of memory units to the specified process
D)  Deallocate memory of the specified process
R)  Report Process and Memory status of the system
E)  Exit the Memory Management program 


Explanation of each command:

A)   Allocate the specified number of memory units to the specified process

For this command your program prompts the user to enter the id for the process. You should make sure that the entered id is a number between 1 to 20 and also not already in the system. Then another prompt asks the user to enter a number between 3 to 10, as the number of memory units the user wants to allocate to the process. For the very first process memory allocation starts from location 0. The following allocations all start from the end of previous memory allocation (causing no hole in memory allocation). Effectively, this would be the first free memory unit coming right after the last allocated memory unit. Every time this command is selected by the user, a new process should be created and some units of memory specified by the user are allocated to that process (every new allocation adds a new row to the memory allocation table). 

D) Deallocate memory of the specified process

For deallocation requests, the user 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 (no partial deallocation is supported). As part of a deallocation execution, as explained earlier, all the following processes are moved upwards by the number of memory units of the deallocated process. This is implemented by shifting/adjusting the memory allocation addresses for all following processes. The deallocated process row in the output table should also be deleted. You should update the values for Total Memory Used and Total Memory Units too. Total Memory Units new value should be the old value minus number of memory units of the deleted process. Total Memory Used new value should be the old value minus the amount of memory used for the deleted process. 

R) Report Process and Memory status of the system

For report you need to create the following table. The table has four columns and one row for each process. You need to evaluate and show the value of two other parameters: Total Memory Used and Total Memory Units. These two parameters are evaluated based of memory usage of all processes.  

The following shows an example. 

 

PID

Start Location

# of Units

Memory Used

 

1

0

5

5000

4

5

3

3000

Total Memory Used: 8000
Total Memory Units: 8


PID
 – Process ID, the number the user enters
Start Location – the location of the first memory unit where the program starts
# of Units – number of memory units allocated to a process, the number the user enters
Memory Used – the amount of memory in bytes allocated to each process


E)  Exit the Memory Management program

Exit the program.

Note: The memory allocation/deallocation technique described in this lab is not a method used in real life computer systems. It’s a simplified method showing covering some of the characteristics of memory management allocation. 
 

Our guarantees

Study Acers provides students with tutoring and help them save time, and excel in their courses. Students LOVE us!No matter what kind of essay paper you need, it is simple and secure to hire an essay writer for a price you can afford at StudyAcers. Save more time for yourself. Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Our Homework Writing Disciplines

With a highly diverse team in almost all academic fields including:


Warning: Invalid argument supplied for foreach() in /home/acemfljg/public_html/wp-content/themes/essay-writing/footer.php on line 12