Implement a separate memory component

Assignment Help Operating System
Reference no: EM13917812

Main Memory Allocation

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 Memory component that implements a specific allocation/deallocation technique, arequest 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. intallocate_mem(intprocess_id, intnum_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. intdeallocate_mem(intprocess_id): deallocates the memory allocated to the process whose ID is process_id. It returns 1, if successful, otherwise "1.

3. intfragment_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.

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

Reference no: EM13917812

Questions Cloud

Elements of a contract-providing examples to help : Identify, define, and discuss the 6 elements of a contract, providing examples to help further the understanding of each element.
Most of the stock valuation models discussed in the textbook : Most of the stock valuation models discussed in the textbook (with the exception of the P/E multiple model) employ a discount rate to find the present value of a particular variable. Are the value estimates derived from the models positively or negat..
The data dictionary back to top : document titled MySQLOmnymbusSupport.docx located in the Doc-Sharing folder titled Omnymbus Tutorial Files for instructions on how to get help for any issues that you are having with the MySQL/Omnymbus Environment.
Use for debt when calculating the cost of capital : DeVille Industrial Machines issued 143,000 zero coupon bonds four years ago. The bonds originally had 30 years to maturity with a 7.3 percent yield to maturity. Interest rates have recently increased, and the bonds now have an 8.4 percent yield to ma..
Implement a separate memory component : 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.
Knowledge of accounting and financial : You have been selected as the consultant to develop a business plan for Durango Manufacturing Company, which is a start-up, medium-sized public manufacturing company. The CEO has a background in manufacturing and is well versed in supply chain man..
About the yield curve : Find the 3-year implied forward rate one year and two years from now (the expected 3-year spot rate starting one year from now and two years from now). State the final answers as an annual rate.
Stakeholders and project team members : As the project manager for the District 4 Warehouse Move project, you will need to determine who your stakeholders and project team members are for this project. Remember that anyone connected to the project who has an interest or stake in the pro..
Liquidity issues with investment portfolio : Freeman Bank is concerned about liquidity issues with its investment portfolio. As an investment manager for Freeman, prepare a 750-word report for senior management that explains liquidity.

Reviews

Write a Review

Operating System Questions & Answers

  Management information systems

Analyze and apply the content from a minimum of 3-recent articles about a topic of interest covered in the module.

  Write a brief description about the system calls

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

  Use of the ipc facilities provided by unix

The purpose of this program is to change such that it makes use of the IPC facilities provided by UNIX.

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  One page document describing security

Analyze the Internet and construct a one page document describing how security is maintained while transacting business over the Internet.

  Question about it planning

Some companies think that IT planning is a waste of time because the competitive environment and technologies change too rapidly.

  How smart phones used in running a business

Can you run your company out of your pocket? Discuss how smart phones, tablets, and other mobile devices can be used in running a business. Consider all types of devices such as Android, Blackberry, iPhone, iPad and Windows Phone 7.

  Consider a scheduling scenario

Consider a scheduling scenario in which a job of size (processing time) 50ms arrives every 60 ms, and 10 jobs of processing time 1ms arrive every 6 ms. Which algorithm: First Come First Serve, or Shortest Remaining Processing Time, would provide b..

  When a process is multithreaded

Explain the differences, advantages, and disadvantages between user and kernel threads. What are the advantages and disadvantages of a lightweight process?

  Consider a scenario of post mailbox there are two processes

consider a scenario of post mailbox there are two processes named sender s and receiver r. both processes can

  Discuss the merits of each file management system

Discuss the merits of each file management system - Methods available for file manipulation and how user-defined permissions are implemented and can be examined.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

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