Computer Science BS Journal (CST334) : Week 4
This week in CST334 our lectures covered: Paging, Translation Lookaside Buffers, Multi-Level Paging, and Swapping. In this learning journal I'll write and explanation/what I think to be the most important bits of each subject.
Paging
Paging is a memory management scheme that eliminates the need for contiguous memory allocation. It divides physical memory into fixed-size blocks called frames and logical memory (processes) into blocks of the same size called pages.
Key Takeaways:
-
Avoids external fragmentation.
-
Simplifies memory allocation.
-
Requires a page table to map virtual pages to physical frames.
-
Introduces a level of indirection, so address translation is needed.
Translation Lookaside Buffers (TLBs)
A TLB is a small, fast, cache used to store recent translations of virtual addresses to physical addresses. Since page table lookups can be slow, the TLB helps speed up the translation process.
Key Takeaways:
-
TLB reduces memory access time by caching page table entries.
-
A TLB hit is fast; a TLB miss requires a full page table lookup.
-
Efficiency depends on locality of reference (temporal/spatial).
Multi-Level Paging
To manage large address spaces (e.g., in 64-bit systems), page tables can become huge. Multi-level paging reduces memory used by breaking the page table into levels, each of which can be paged.
Key Takeaways:
-
Saves space by only allocating page table levels when needed.
-
Translates addresses in multiple steps: outer to inner page tables.
-
Adds overhead, but it’s more memory-efficient for sparse address spaces.
Swapping
Swapping involves moving a process (or part of it) in and out of main memory to/from disk to make room for other processes. It helps in managing memory when there’s more demand than RAM available.
Key Takeaways:
-
Allows overcommitment of physical memory.
-
Slower due to disk I/O—used as a last resort.
-
May cause thrashing if overused (constant swapping, hurting performance).
Comments
Post a Comment