ECM 1413 memory management Flashcards
Virtual memory segmentation pros and cons
+can fit processes larger than memory
+Segment Sharing and protection
+No internal fragmentation
+Efficient compared to static partitioning
-more complex memory management
Paging
Memory divided into equal fixed-size frames
A process is divided into same-size pages
Internal fragmentation is small as
- Only affects the last frame of each process
- The frame/page-size is fairly small
Paging pros and cons
+no external fragmentation
+Simple memory allocation
-small internal fragmentation
-page tables can become large
Internal fragmentation
the memory is split into mounted-sized blocks. Whenever a method is requested for the memory, the mounted-sized block is allotted to the method. In the case where the memory allotted to the method is somewhat larger than the memory requested, then the difference between allotted and requested memory is called internal fragmentation.
We fixed the sizes of the memory blocks, which has caused this issue. If we use dynamic partitioning to allot space to the process, this issue can be solved.
External Fragmentation
there’s a sufficient quantity of area within the memory to satisfy the memory request of a method. However, the process’s memory request cannot be fulfilled because the memory offered is in a non-contiguous manner. Whether you apply a first-fit or best-fit memory allocation strategy it’ll cause external fragmentation.
(Space is wasted between partitions)
Virtual memory paging
Paging + virtual memory
Pages are loaded into frames like simple paging, except not all pages need to be loaded at the same time.
Pros and cons of virtual memory paging
+Can fit processes larger than memory
+No external fragmentation
+Simple memory allocation
-Virtual memory overhead
-Small internal fragmentation
-Page tables can become large
Protection and sharing with segmentation and paging
Goals:
- Protection: Each process can only access its own pages/segments
- Sharing: Multiple processes can access the same page/segment
Protection and sharing with segmentation and paging Implementation:
Implementation:
- Each frame/segment has a number of protection bits specifying
○ Read, write, execute permissions, which processes have these permissions
Memory management techniques
Fixed Partitioning
Dynamic Partitioning
Simple Segmentation
Virtual Memory Segmentation
Simple Paging
Virtual Memory Paging
Fixed/Static Partitioning
Memory divided into partitions of fixed boundaries (equal or unequal sizes)
1-to-1 mapping of partitions and processes
Process loaded into partitions ≥ its size
Fixed Partitioning Pros and Cons
+Easy to understand and implement
+No external fragmentation
-Internal Fragmentation
-Limited by number & size of partitions
Dynamic Partitioning
Exact memory allocation – only what is needed
- Partitions of variable length and number
- 1-to-1 mapping
Starts well, then leads to external fragmentation
Compaction
Shift processes for unified free memory space
Dynamic partitioning Pros and Cons
+No internal fragmentation
+Efficient than static partitioning
-External fragmentation
-Overhead of compaction