Tuesday, July 16, 2024

CST 334 - Week 4

 This week we learned more about memory virtualization mainly involving paging. Similar to segmentation, which divided the address space into variable-sized pieces, paging chops up the address space into fixed size pieces. We keep track of available pages in a "free list" and a page table stores the address translations from virtual to physical memory. This approach can also be slower than desired, so an OS works with hardware in order to make things more efficient. A TLB, or translation-lookaside buffer, is a hardware cache of popular virtual-to-physical address translations. Whenever there is a reference to virtual memory, the TLB is checked first, before having to search through the page table to find an entry. This has an incredible effect on performance.

We also learned a bit about swapping. This concept allots a bit of memory called a swap space. This is used when memory gets full and allows the OS to swap in and out pages as necessary using a page-replacement policy. A "high watermark" (HW) or "low watermark" (LW) helps to decide when an OS should start removing pages from memory. Once the OS realizes that there are fewer than LW pages available, a background thread starts evicting pages until the HW is reached. All of these things happen behind the scenes, and still support the illusion that each process has its own private, contiguous address space.

No comments:

Post a Comment