Week 3 - CST 334
This week we learned about address spaces and how virtual address spaces create this illusion of partitioned memory spaced even though it is all shared on physical memory. We also learned how to allocate and free up memory space using malloc() and free(). After allocated memory, malloc() returns a pointer to it. Using base and bounds, we perform address translation. The base and bounds are values of where the process is located. This helps protect data from being access by preventing processes to accessed locations that are not in its bounds. We also learned about segmentation which is where memory is slip into segments like code, heap and stack. The beginning two bits of a virtual memory address shows where the process is located. A location in the code begins with 00, a location in the heap begins with 01 and a location in the stack begins with 11. By segmenting memory, we are able to grant certain permissions based on what the segment does. Finally, we learned about free-space management. There are several ways in which free memory is tracking like having lists of sections that are free, busy and a list of history of all malloc() and free() calls. There are several ways in which memory can be allocated, as defined by the policies first fit, best fit, worst fit. These policies can either help efficiency, keep large chunks, or avoid fragmentation.
Comments
Post a Comment