CST 334 Week 3

This week in CST 334 we dived into the foundational concepts of memory virtualization. We started with the idea of the address space, which is the abstraction the operating system provides to a running program. It was interesting learning that every process gets its own private virtual memory, starting from address zero, completely isolated from other processes. This illusion of a large, contiguous memory space simplifies things immensely for programmers. We then connected this abstraction to the practical tools we use in C, like malloc() and free(). It was eye-opening to see the direct link between a high-level concept like an address space and the low-level memory allocation calls that can lead to so many common bugs, such as memory leaks or buffer overflows. Understanding the underlying system makes it much clearer why managing memory carefully is so critical. The OS is doing a ton of work behind the scenes to maintain this illusion, and the C memory API is our direct interface to that system.

From there, we explored the mechanisms that make this virtualization possible. The initial concept of address translation using a base and bounds register was a great starting point. It’s a simple and effective way to ensure protection by confining a process to its allocated physical memory, but its limitations became clear quickly, especially with the problem of internal fragmentation, or wasted space within the allocated chunk. Segmentation was presented as a more logical approach, dividing the address space into segments like code, stack, and heap. This feels more intuitive because it maps to how a program is actually structured. However, this introduced the new challenge of external fragmentation, where free memory is broken into small, non-contiguous pieces that can't satisfy a large allocation request. This perfectly set up the final topic of free-space management. Learning about strategies like best-fit, worst-fit, and the underlying data structures like free lists really tied everything together. It's a constant game of trade-offs between speed, efficiency, and complexity for the OS designer, and seeing this evolution from simple base-and-bounds to more complex segmentation and management strategies was a key takeaway for me this week.

Comments

Popular posts from this blog

CST Module 4 January 29th - February 4th

CST300 Module 1 January 8th - January 14th

CST Module 3 January 22nd - January 28th