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

  Identify properties of communication channel

Write the send and receive primitives for stated processes. Identify at least three properties of communication channel or link in this scheme

  Design virtual memory system for new operating system

You are asked to design the virtual memory system for a new operating system working on small mobile devices. The memory operates at 333 MHz with a word size of 4 bytes.

  Question 1a what is the main advantage of multiprogrammingb

question 1a what is the main advantage of multiprogramming?b how does the distinction between the monitor mode and user

  Printf statement to debug an application

There are various ways to debug a program, perhaps most elementary is using a printf() statement to show important pieces of data regarding the program execution point,

  Set of three uml class relationship diagrams

Prepare a set of three UML class relationship diagrams highlighting important relations among the discovered classes. Each diagram should give a coherent picture of relations among 3-5 classes.

  Formulate the above in terms of a linear programming problem

Formulate the above in terms of a Linear Programming problem Solve this linear program graphically. Determine the quantity of each type of toaster that will maximise the maximum profit

  Question 1a explain two reasons driving the creation of

question 1a explain two reasons driving the creation of processes.b suppose we want a system to have two ready states

  Header fields in the ipv4 and ipv6 protocols

Compare the header fields in the IPv4 and IPv6 protocols. Explain strategies for converting IPv4 packets to IPv6 packets in a hybrid IP network.

  Threads in a multi-threaded process

What components of program state are shared across threads in a multi-threaded process? Can someone provide the answer with reference to operating system?

  Question 1a four special cases and difficulties arise at

question 1a four special cases and difficulties arise at times when using graphical approach to solving lp problems.

  Time consuming phase of the data warehousing project

Proper design and implementation of the ETL process is crucial to a BI project. ETL is considered the most time consuming phase of the Data Warehousing project. Therefore, anything that might go wrong with this process will significantly affect the s..

  Discuss and provide examples of mutual exclusion

Discuss and provide examples of the following concurrency issues associated with an OS: 1. Mutual exclusion 2. Deadlock 3. Starvation

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