-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMemoryManager.txt
48 lines (43 loc) · 2.9 KB
/
MemoryManager.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.TH Memory Manager
.SH Name: Kemari Chen Loy
.SH Course: Operating Systems
.SH
.SH Project 2 - Memory Manager
Memory Manager \- Implement a Memory Manager in C++.
.SH DESCRIPTION
Created various classes and methods in C++ to complete a Memory Manager(MM) model. This MM will allocate and deallocate portions of memory.
.PP
1). Created Three Classes:
.br
Linked List, MyBitMap and MemoryManager.
.PP
.b
My Linked list was used to track the memory that was being occupied and also the memory that was being freed. The singly linked list can do this with the implementation of the node concept.
.b
My MyBitMap class was used for tracking the holes generated by the blocks of memory that would be allocated for use.
.b
My Memory Manager class called my other classes for full functionality. This class is responsible for allocation and deallocation of memory and provides details of its state.
.PP
In my singly linked list I ensure that the allocated memory gets cleared when needed, I calculate the size or length of the offset provided, I add a new block of memory by traversing to find an empty node and create one if found. I also deleted a node at a given value of the offset.
.PP
.b
In my mybitmap class I traverse the length and offset of the hole and then set that value to keep track of how big the hole is, I also verified if the memory buffer is correctly allocated and set 1 if it is. I initialized the hole to zero and then looped through to find the beginning of the holes is less than the memory range. if a hole was found, I would increment the hole count. Created an array to keep track of length and offset. For the output I, traversed the length of the hole and then check to see if memory is allocated and then used the shifting method to convert the binary numbers. I also was able to get the correct output for dump memory map by calculating the range of the offset and holes and then formatting for the correct string output, doing this will cause for extra strings to be created however, I was able to counter that issue.
.PP
In my memory manager class, I deleted all the memory allocated and free up all the necessary process by using the new and delete key words. Allocate was a bit tricky, I had to create a void pointer to hold the list of holes my getList function calculated.
.PP
.SH Testing
I ran a few debugging tests myself by placing cout statements in parts of my code to understand how my functions were calculation the given data. However, I mainly used the provided test for functionality. I also used valgrind to test for memory leaks.
.SH Video
https://youtu.be/37Iu3TC9snw
.SH References
These were used in the completion of this project:
.PP
https://developer.ibm.com/tutorials/au-memorymanager/
.PP
Juan Calle - Oracle Employee
.PP
Dale Davis - Lockheed Martin employee
.PP
Tevin Thames - Intel Employee
.PP
Linked List project from Programming 1