Fill in Order Details

  • Submit paper details for free using our simple order form

Make Payment Securely

  • Add funds to your account. There are no upfront payments. The writer will only be paid once you have approved your paper

Writing Process

  • The best qualified expert writer is assigned to work on your order
  • Your paper is written to standard and delivered as per your instructions

Download your paper

  • Download the completed paper from your online account or your email
  • You can request a plagiarism and quality report along with your paper

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. 
 

WHAT OUR CURRENT CUSTOMERS SAY

  • Google
  • Sitejabber
  • Trustpilot
Zahraa S
Zahraa S
Absolutely spot on. I have had the best experience with Elite Academic Research and all my work have scored highly. Thank you for your professionalism and using expert writers with vast and outstanding knowledge in their fields. I highly recommend any day and time.
Stuart L
Stuart L
Thanks for keeping me sane for getting everything out of the way, I’ve been stuck working more than full time and balancing the rest but I’m glad you’ve been ensuring my school work is taken care of. I'll recommend Elite Academic Research to anyone who seeks quality academic help, thank you so much!
Mindi D
Mindi D
Brilliant writers and awesome support team. You can tell by the depth of research and the quality of work delivered that the writers care deeply about delivering that perfect grade.
Samuel Y
Samuel Y
I really appreciate the work all your amazing writers do to ensure that my papers are always delivered on time and always of the highest quality. I was at a crossroads last semester and I almost dropped out of school because of the many issues that were bombarding but I am glad a friend referred me to you guys. You came up big for me and continue to do so. I just wish I knew about your services earlier.
Cindy L
Cindy L
You can't fault the paper quality and speed of delivery. I have been using these guys for the past 3 years and I not even once have they ever failed me. They deliver properly researched papers way ahead of time. Each time I think I have had the best their professional writers surprise me with even better quality work. Elite Academic Research is a true Gem among essay writing companies.
Got an A and plagiarism percent was less than 10%! Thanks!

ORDER NOW


Consider Your Assignments Done

“All my friends and I are getting help from eliteacademicresearch. It’s every college student’s best kept secret!”

Jermaine Byrant
BSN

“I was apprehensive at first. But I must say it was a great experience and well worth the price. I got an A!”

Nicole Johnson
Finance & Economics

Our Top Experts

See Why Our Clients Hire Us Again And Again!


OVER

10.3k
Reviews

RATING
4.89/5
Average

YEARS
13
Mastery

Success Guarantee

When you order form the best, some of your greatest problems as a student are solved!

Reliable

Professional

Affordable

Quick

Using this writing service is legal and is not prohibited by any law, university or college policies. Services of Elite Academic Research are provided for research and study purposes only with the intent to help students improve their writing and academic experience. We do not condone or encourage cheating, academic dishonesty, or any form of plagiarism. Our original, plagiarism-free, zero-AI expert samples should only be used as references. It is your responsibility to cite any outside sources appropriately. This service will be useful for students looking for quick, reliable, and efficient online class-help on a variety of topics.