Different memory allocation and deallocation techniques

Assignment Help Operating System
Reference no: EM13726708

The objective of this 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 needs two seperate c++files. One allocation/deallocation technique for one, and the second technique on the other c++ file.

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 Memory component 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:

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.

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.

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.

Reference no: EM13726708

Questions Cloud

Compute the importance of a company : Evaluate the importance of a company having a robust information management system strategy. Recommend two (2) actions that a company may take in order to protect its information assets from potential disruption and loss
Medical calculator srs excerpts : Choose one of the use cases and develop detailed use case steps using the Use Case Template. See the Medical Calculator SRS Excerpts for an example of a use case.Make certain that you use the Use Case Template. Also review Developing Use Cases wit..
Importance of research for starting a new business : Write an annotated bibliography of 1-2 pages in Microsoft Word format utilizing five different resources. Importance of Research For Starting A New Business
Compare the healthcare-based factors in the issues : Cost of production - The cost of producing pharmaceuticals in a highly completive market
Different memory allocation and deallocation techniques : The objective of this 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.
Examine how americas connected their ideas of liberty : Examine how Americas connected their ideas of "liberty" with the West. Why do historians call this period the "Gilded Age"? Is it an accurate description?
What are the implications of event for our economy : While some of you may not choose to enter economics as a profession, hopefully you have gained some understanding of economic issues from the course. Pick any current event that interests you.
What determines the size of the employment effect : What determines the size of the employment effect of a minimum wage increase in the model of perfect competition and what is meant by monopsony power and why might firms have it?
Summary of the background and facts : Case study-Reliance Baking Soda: Optimizing Promotional Spending, Summary of the background and facts

Reviews

Write a Review

Operating System Questions & Answers

  Generate the special login script

Design and implement the disableuser.sh script. Generate the special login script that incorporates the quoted message.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Shared data problem what is shared data problem explain in

what is shared data problem ? explain in briefly ? which is related to embedded system topics ? ltbrgt

  Procedure to manually remove the existing power supply

Explain the procedure necessary to properly install or replace the computer power supply in a computer.

  Difference between passive and active intrusion detection

Discuss the difference between passive and active intrusion detection? Passive intrusion detection will detect and record intrusion attempts, but it does not take action.

  Explain the elements and capabilities of a fault

Discuss briefly the network management software components and describe the elements and capabilities of a fault, configuration, accountingn and security server.

  A- please answeronly two ofnbsp the following questions

a- please answeronly two ofnbsp the following questions that are related to the file

  Define cache and its purpose

Describe what a cache is and what its purpose is. Also explain what data gets placed into the cache, and when it is put there.

  What is a thread

What types of problems lend themselves to Processes? Is one better than the other? Why or Why Not.

  Frequency definition of bandwidth

In data communication we often use term "bandwidth" when we refer to capacity of a link. Strictly speaking, however, bandwidth refers to range of frequencies that can be carried on a link.

  Describe the windows kernel

Describe the Windows kernel, including its two main components.

  Information such as parameters, resources used

Write a brief description about the following system calls used in Unix/Linux. Include information such as parameters, resources used, expected results/return values, and possible error conditions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd