Commit 7e941389 authored by cdf009's avatar cdf009

prelab7

parent 65749dd6
Reflecton how processes will cause insertions and removals in the doubly-linked lists that keep track of the memory that is allocated or free. Discuss whether doubly-linked lists are suitable for use in a custom memory allocator. (4 points)
Doubly-linked lists are suitable for the use of custom memory allocators, but they are not the most efficient way. The insert into the free-list will happen with memory allocation where the remove in the list will be deallocated.
Propose one or more data structures that might work as well or possibly better than doubly-linked lists for keeping track of allocated and free memory. (4 points)
I believe that an array would work as well and better than a doubly linked list. This is due to the fact that indexing is free in an array and you will be able to index to find/set memory address allocations.
Define the term external fragmentation and describe a scenario where it occurs. (3 points)
External fragmentation is when we organize the free memory is broken out into smaller blocks. In this setting we will have little holes in between the blocks with allocatted memory put through out.
This will happen after a first fit.
Define the term internal fragmentation and describe a scenario where it occurs. (3 points)
Internal fragmentation is when we also organize memory in the settings of blocks, but here there is not holes in between blocks by but rather there are space in the blocks. For examples, the blocks have to be of sizes that are powers of 2 and if you have something that needed to be stored in 15 bits, you would have an extra bit not allocated in a 16 bit block.
Describe the first-fit allocation policy. Give one advantage and one disadvantage of its use. (4 points)
This is when we ensure that the first block is largest enough to capture the the first fit. The advantage of this process is that it does not need to look at the whole memory map as you only need to find one that is big enough. The disadvanatges is that this could lead to external fragmentation as the memory space is not allocated very efficiently.
Describe the best-fit allocation policy. Give one advantage and one disadvantage of its use. (4 points)
This is when we will place in the memory block that fits the closest so that it is the smallest but not too smaller. The advantage is that large blocks will not be taken up early on and therefore will be more efficnet. The disadavantge is that you have to look at the whole memory map.
Describe the worst-fit allocation policy. Give one advantage and one disadvantage of its use. (4 points)
This is when we place in the largest memory block availible. The advantage is always knowing that when placing in to the block that if it is open, you will have enough space. The disadvantage is that later on if you want to place large memory into blocks, there may not be blocks left that can hold memory of that size.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment