This commit is contained in:
Powers, Joshua
2022-10-16 13:27:00 -05:00
parent 09aca2875d
commit 6e2929a32a

View File

@@ -219,69 +219,3 @@ Each of the three placement algorithms have advantages and disadvantages.
Despite the advantages and disadvantages, there is no perfect placement algorithm. It is possible to come with a combination of allocations and frees that cause lots of wasted space.
As part of your lab report, perform some experiments with the different placement algorithms. Create a series of allocations and frees and report the number of fragments, number of successful allocations along with the total amount of free space. A placement algorithm is considered 'bad' for a set of allocations and frees if the total amount of free space is large enough to satisfy requests, but the fragments themselves are not big enough to satisfy a contiguous block.
## Deliverables
You will need to include all your source files, test case parameter files, and any other resources you used to complete lab. Please don't just google search for a solution, but if you do use Google for any help, include a description and URL of what you used to help you.
A makefile is useful, but optional for this assignment. If you created a makefile, include it in your submission.
All files should be well documented with function comment blocks and inline comments that explain complicated code routines. While no explicit style guidelines are set for programming in this course, code should be documented and readable. Include your name, section, and lab name in a comment block at the top of each file.
NOTE: do ***NOT*** submit any IDE configuration files (.idea, project files, etc.). Only submit your source files and report.
Prepare a lab report and submit it along with your source code. The report should include the following:
- Your name, section, date, and lab title
- Introduction a description of the lab in your own words
- Design a description of your design decisions in creating your solution
- Resources a description of any external resources you used to complete the lab
- Build instructions on how to build and run your program. Include the exact commands that are necessary
- Analysis - Discuss the key concepts from the lab and your experimental results and answer the following questions.
- What placement algorithm worked the best for your experimental allocations and frees in terms of the number allocations that were successful? Why do you think this is the case?
- The time complexity for an algorithm defines an estimate for how long it will run based on the input size. It is advantages to keep the OS CPU overhead as low as possible. Any OS algorithm that runs in longer than constant time O(1) is often considered to be too high although sometimes this is not possible.
- What is the time complexity of your mymalloc and myfree?
- Is your algorithm acceptable? Why or why not?
- How could you implement your memory manager differently to improve the time for mymalloc and myfree?
- The memory overhead consists of the amount of extra memory needed by the OS for keeping track of memory blocks. It is advantageous to keep the OS memory overhead as low as possible.
- For a set of 'n' successful memory allocations, about how much additional memory (on average) does your memory manager use?
- Can you think of a better way to implement your memory manager that uses less memory overhead with the potential cost of additional CPU usage?
- Memory leaks can be a problem especially for long-lived processes (those that run for a long time or forever). Could you use the structures in your memory manager to detect client memory leaks? Explain your algorithm or explain why it's not possible.
- Conclusion
- Summary of what you learned in the lab
- What specifically was challenging about this lab?
- What did you like about it?
- What could we do to improve it for others?
NOTE: You should ensure that this program compiles without warning (-Wall and -Wextra) prior to submitting.
Prepare a zip file with all submitted files and upload the file to Canvas per your instructor's instructions.
## Extra Credit
While dynamic memory allocation (e.g. the use of malloc) within the OS kernel is possible, it is often advantageous to limit the use of this as much as possible to avoid any potential for memory leaks within the kernel.
For example, internally in the Linux kernel kmalloc() is used ([https://www.kernel.org/doc/htmldocs/kernel-api/API-kmalloc.html](https://www.kernel.org/doc/htmldocs/kernel-api/API-kmalloc.html)) as a way to dynamically allocate blocks within the OS kernel's address space.
As a bonus challenge, can you find a way to implement your bookkeeping data structure so that it does not need to use malloc and free internally?
- It must still be able to manage a region of memory that is of varying size. The memory manager doesn't know how big the region is until the call to mmInit is made.
- It must still be able to keep track of a potentially unlimited number of memory fragments and allocated blocks.
- must still be thread safe
- It must keep track of all required statistics
HINT: You can use a portion of the memory region given to you by the user. This will reduce the total amount of storage that can be allocated from the block, but that is fine provided you can avoid using malloc and free internally.
## Grading Criteria
- (35 Points) Report
- (5 Points) Report Introduction - Thorough description of the lab in your own words.
- (5 Points) Design and Testing Methodology - Detailed description of design and method for testing your implementation.
- (20 Points) Analysis - Answers to the analysis questions
- (5 Points) Conclusion - Thorough conclusion with description of what you learned, what you liked, and suggestions for lab improvements.
- (5 Points) Documented Resources - Description of external resources used to complete the lab
- (5 Points) Correct Submission - Followed submission instructions (e.g. IDE project files are not submitted)
- (5 Points) Build - Code compiles without warnings or errors
- (10 Points) Test Cases - Thoroughness of submitted test cases
- (35 Points) Instructor Tests - Implementation passes all instructor test cases
- (5 Points) Memory Management - Program execution is free from memory leaks