module 3 Flashcards

1
Q

Front

A

Back

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. Page Frames & Page Tables: What is a page frame?
A

A page frame is a fixed-size block in physical memory used to hold a page from a process’s logical address space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. Page Frames & Page Tables: What is a page table?
A

A page table is a data structure that maps a process’s logical page numbers to the corresponding physical page frames.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. Page Frames & Page Tables: How do page frames and page tables work together?
A

They work together by having the page table translate logical addresses (comprising a page number and an offset) into physical addresses where the page frames reside.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. Page Frames & Page Tables: Describe the process of address translation using a page table.
A

The CPU generates a logical address (page number and offset); the page table is then consulted to find the corresponding frame number, which is combined with the offset to create the physical address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. Page Frames & Page Tables: What is an example of a page table mapping?
A

For example, if logical page 3 maps to physical frame 7, any address in page 3 is translated to frame 7 with the same offset.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. Page Frames & Page Tables: What is the benefit of using page frames and page tables?
A

They allow non-contiguous memory allocation, reducing external fragmentation and enhancing memory management flexibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. Page Frames & Page Tables: How do page tables compare to contiguous allocation?
A

Unlike contiguous allocation, page tables allow pages to be loaded into any available frame, reducing fragmentation and improving memory utilization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. Fixed & Variable Partitioning: What is fixed partitioning in memory allocation?
A

Fixed partitioning divides the memory into fixed-size regions or partitions regardless of the process size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. Fixed & Variable Partitioning: What is variable partitioning?
A

Variable partitioning dynamically allocates memory regions that exactly fit the size requirements of a process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. Fixed & Variable Partitioning: What is the main drawback of fixed partitioning?
A

Fixed partitioning can lead to internal fragmentation when a process does not fully use its fixed-sized partition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. Fixed & Variable Partitioning: What is the main drawback of variable partitioning?
A

Variable partitioning can cause external fragmentation because memory blocks vary in size and can leave unused gaps between them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  1. Fixed & Variable Partitioning: How does fixed partitioning simplify memory management?
A

It simplifies allocation since partitions are predetermined, though this rigidity can waste memory if process sizes are smaller than the partition sizes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. Fixed & Variable Partitioning: How does variable partitioning improve memory utilization?
A

By allocating memory based exactly on process size, it minimizes wasted space, albeit at the cost of potential external fragmentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. Fixed & Variable Partitioning: Compare fragmentation issues in fixed versus variable partitioning.
A

Fixed partitioning suffers from internal fragmentation while variable partitioning is prone to external fragmentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q
  1. Address Space vs. Memory Space: What is an address space?
A

An address space is the complete range of addresses that a process can use, typically referring to its logical (virtual) addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q
  1. Address Space vs. Memory Space: What is memory space?
A

Memory space refers to the actual physical memory (RAM) available in the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q
  1. Address Space vs. Memory Space: How do address space and memory space differ?
A

Address space is the abstract set of addresses used by a process, while memory space is the real, physical locations in RAM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q
  1. Address Space vs. Memory Space: Why is the concept of address space important?
A

It provides process isolation and security, ensuring that each process works within its own separate set of addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q
  1. Address Space vs. Memory Space: What role does the page table play in this context?
A

The page table maps the logical address space to the physical memory space, enabling the translation from virtual to physical addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q
  1. Address Space vs. Memory Space: How does logical-to-physical mapping occur?
A

A logical address is split into a page number and offset; the page table translates the page number to a physical frame, and the offset is used to access the exact memory location.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q
  1. Address Space vs. Memory Space: Give an example comparing address space and memory space.
A

A process might have a 4GB address space (logical) even though the system’s physical memory (memory space) is 8GB, with the page table handling the mapping.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
26
33. Page Faults: What is a page fault?
A page fault occurs when a process attempts to access a page that is not currently in physical memory (RAM).
27
33. Page Faults: What typically causes a page fault?
It is typically caused by a page not being loaded yet or being swapped out to disk, triggering the need to fetch it.
28
33. Page Faults: How does the operating system handle a page fault?
The OS intercepts the fault, locates the missing page on disk, loads it into a free frame (or replaces an existing one), and then resumes process execution.
29
33. Page Faults: What role does a page replacement algorithm play during a page fault?
If no free frame is available, a page replacement algorithm is used to decide which existing page should be evicted to make room for the new page.
30
33. Page Faults: Explain the steps involved in servicing a page fault.
1. The OS detects the page fault. 2. It locates the required page on disk. 3. It selects a frame (possibly replacing an existing page). 4. It loads the page into memory. 5. Execution resumes.
31
33. Page Faults: What impact can frequent page faults have on system performance?
Frequent page faults can lead to significant performance degradation due to excessive disk I/O and CPU time spent handling faults.
32
33. Page Faults: Provide an example scenario that triggers a page fault.
If a process accesses page 5 for the first time or after it has been swapped out, a page fault is triggered to load page 5 into memory.
33
34
34. Logical vs. Physical Address: What is a logical address?
A logical address is the address generated by the CPU, representing a location in the process's virtual address space.
35
34. Logical vs. Physical Address: What is a physical address?
A physical address is the actual location in the system's physical memory (RAM) where data is stored.
36
34. Logical vs. Physical Address: How are logical and physical addresses related?
Logical addresses are translated into physical addresses by the operating system using mechanisms such as page tables.
37
34. Logical vs. Physical Address: What role does the CPU play in address generation?
The CPU generates logical addresses during program execution, which are then translated to physical addresses.
38
34. Logical vs. Physical Address: What are the key differences between logical and physical addresses?
Logical addresses are virtual and used by programs; physical addresses refer to the actual memory locations in hardware.
39
34. Logical vs. Physical Address: How does the address translation process work?
The logical address is divided into a page number and offset; the page table maps the page number to a physical frame, and the offset gives the exact location within that frame.
40
34. Logical vs. Physical Address: Why is distinguishing between logical and physical addresses important?
It ensures effective memory management, security, and process isolation by abstracting the actual physical memory from the process.
41
42
35. Multiple Partition Allocation: What is multiple partition allocation?
It is a memory management technique that divides memory into several partitions, each allocated to a different process.
43
35. Multiple Partition Allocation: What are the two main types of partition allocation?
The two main types are fixed partitioning and dynamic (variable) partitioning.
44
35. Multiple Partition Allocation: How does fixed partition allocation work?
Fixed partition allocation divides memory into pre-set, equal-sized partitions, each of which is assigned to a process regardless of its size.
45
35. Multiple Partition Allocation: How does dynamic partition allocation work?
Dynamic partition allocation assigns memory blocks to processes based on their exact size requirements, creating variable-sized partitions.
46
35. Multiple Partition Allocation: What is a key advantage of fixed partition allocation?
Its simplicity and ease of allocation, as partition sizes are predetermined.
47
35. Multiple Partition Allocation: What is a key disadvantage of fixed partition allocation?
It often leads to internal fragmentation if the process size is smaller than the fixed partition size.
48
35. Multiple Partition Allocation: How does dynamic partition allocation impact fragmentation?
It can lead to external fragmentation since memory blocks vary in size and gaps may form between allocated partitions.
49
50
36. Contiguous Memory Allocation: What is contiguous memory allocation?
It is a memory management scheme in which each process is allocated one single, contiguous block of memory.
51
36. Contiguous Memory Allocation: What is a major issue with contiguous allocation?
It suffers from external fragmentation, where free memory is split into small blocks scattered throughout.
52
36. Contiguous Memory Allocation: What is compaction in this context?
Compaction is the process of shifting processes in memory to consolidate free memory and reduce fragmentation.
53
36. Contiguous Memory Allocation: How does contiguous allocation simplify address translation?
It allows direct mapping of logical addresses to physical addresses using base and limit registers.
54
36. Contiguous Memory Allocation: Compare contiguous allocation with paging.
Contiguous allocation uses one continuous block per process, while paging divides memory into fixed-size pages that can be allocated non-contiguously, reducing fragmentation.
55
36. Contiguous Memory Allocation: What is an advantage of contiguous memory allocation?
It provides simple and fast address translation since the entire process occupies one contiguous block.
56
36. Contiguous Memory Allocation: What is a disadvantage of contiguous memory allocation?
It often leads to inefficient memory use due to external fragmentation and may require costly compaction.
57
58
37. Demand Paging: What is demand paging?
Demand paging is a technique where pages are loaded into memory only when they are needed for execution, rather than all at once.
59
37. Demand Paging: How does demand paging reduce memory usage?
By loading only the required pages, demand paging minimizes the amount of memory in use at any given time.
60
37. Demand Paging: What event triggers a page load in demand paging?
A page fault is triggered when a process accesses a page that is not currently in memory, prompting the load.
61
37. Demand Paging: Explain the process of demand paging.
When a process accesses a page, if it’s not in memory, a page fault occurs, the OS loads the page from disk, and then the process resumes execution.
62
37. Demand Paging: What is an advantage of demand paging?
It improves overall memory utilization by not loading pages until they are needed.
63
37. Demand Paging: How can demand paging impact system performance?
While it can reduce memory usage, frequent page faults may add overhead and affect performance.
64
37. Demand Paging: Provide an example of demand paging in action.
A process begins execution with only its critical pages loaded; as additional pages are accessed, they are loaded on demand via page faults.
65
66
38. FIFO Page Replacement Algorithm: What does FIFO stand for?
FIFO stands for First-In-First-Out, meaning the oldest page loaded is the first to be replaced.
67
38. FIFO Page Replacement Algorithm: What is the basic principle of FIFO page replacement?
It replaces the oldest page in memory when a new page needs to be loaded, regardless of how frequently it is used.
68
38. FIFO Page Replacement Algorithm: How is FIFO implemented?
FIFO is implemented using a queue that tracks the order in which pages were loaded into memory.
69
38. FIFO Page Replacement Algorithm: What happens during a page fault under FIFO?
When a page fault occurs, the page at the front of the queue (the oldest) is removed and the new page is added at the back.
70
38. FIFO Page Replacement Algorithm: Give an example using a reference string.
For the reference string [1, 3, 0, 3, 5, 6, 3] with 3 frames, pages are loaded sequentially and the oldest is replaced when needed.
71
38. FIFO Page Replacement Algorithm: How is the replacement decision made in FIFO?
The decision is solely based on the order in which pages were loaded, replacing the page that entered memory first.
72
38. FIFO Page Replacement Algorithm: What is a drawback of the FIFO algorithm?
It may replace pages that are frequently used if they happen to be the oldest, regardless of actual usage patterns.
73
74
39. Thrashing & Its Impact: What is thrashing in memory management?
Thrashing occurs when the system spends more time handling page faults and swapping pages than executing processes.
75
39. Thrashing & Its Impact: What causes thrashing?
High page fault rates, often due to too many processes or working sets exceeding available memory, can cause thrashing.
76
39. Thrashing & Its Impact: How does thrashing affect system performance?
Thrashing drastically slows down performance as the CPU spends most of its time swapping pages in and out rather than executing instructions.
77
39. Thrashing & Its Impact: What are common indicators of thrashing?
A high rate of page faults and significant drops in CPU utilization indicate thrashing.
78
39. Thrashing & Its Impact: What impact does thrashing have on processes?
Processes may run extremely slowly or stall completely because the system is overloaded with page swapping.
79
39. Thrashing & Its Impact: How can operating systems mitigate thrashing?
By controlling the degree of multiprogramming and optimizing page replacement algorithms, the system can reduce thrashing.
80
39. Thrashing & Its Impact: Provide an example scenario that might lead to thrashing.
When many processes run concurrently with working sets larger than available physical memory, constant paging can occur, leading to thrashing.
81
82
40. Memory Segmentation & Paging for Protection: What is memory segmentation?
Memory segmentation divides a process’s memory into logical segments (such as code, data, and stack) to isolate different types of data.
83
40. Memory Segmentation & Paging for Protection: What is paging?
Paging breaks memory into fixed-size blocks (pages) and allows non-contiguous memory allocation.
84
40. Memory Segmentation & Paging for Protection: How do segmentation and paging provide protection?
Segmentation uses base and limit registers for each segment, while paging uses page tables with protection bits to enforce access rights.
85
40. Memory Segmentation & Paging for Protection: What is an advantage of segmentation for protection?
It isolates different parts of a process, ensuring that code, data, and stack segments are separated and protected.
86
40. Memory Segmentation & Paging for Protection: How does paging enforce protection?
Page tables include protection bits (read, write, execute) for each page, preventing unauthorized access to memory areas.
87
40. Memory Segmentation & Paging for Protection: How do segmentation and paging work together?
Segmentation groups related data logically, and paging further divides segments into pages with detailed access control.
88
40. Memory Segmentation & Paging for Protection: Provide an example of combined segmentation and paging for protection.
A process’s code and data segments are first separated logically; then each segment is split into pages, and the page tables enforce protection rules on each page.
89
90
41. FIFO Page Replacement (Step-by-Step Execution): What is the initial state in FIFO page replacement?
Initially, all page frames are empty, ready to receive pages from the reference string.
91
41. FIFO Page Replacement (Step-by-Step Execution): What is the first step when processing the reference string?
The first page from the reference string is loaded into the first available frame, causing a page fault.
92
41. FIFO Page Replacement (Step-by-Step Execution): How does FIFO handle page faults when frames are full?
FIFO replaces the oldest page in memory—the one that was loaded first—when a new page needs to be loaded.
93
41. FIFO Page Replacement (Step-by-Step Execution): What role does the queue play in FIFO?
The queue maintains the order in which pages were loaded, ensuring that the oldest page is replaced first.
94
41. FIFO Page Replacement (Step-by-Step Execution): Provide an example using a reference string with 3 frames.
For reference string [1, 3, 0, 3, 5, 6, 3], pages are loaded sequentially and the oldest page is replaced when a new page is needed.
95
41. FIFO Page Replacement (Step-by-Step Execution): How is the final page fault count determined?
By counting each instance where a new page is loaded into a frame, resulting in a page fault.
96
41. FIFO Page Replacement (Step-by-Step Execution): What is the final page fault count for the example?
For the given reference string and 3 frames, the final page fault count is 6.
97
98
42. Optimal Page Replacement: What is the principle behind optimal page replacement?
Optimal page replacement selects the page that will not be used for the longest period in the future for replacement.
99
42. Optimal Page Replacement: How does optimal page replacement decide which page to replace?
It looks ahead in the reference string to determine which page’s next use is farthest in the future.
100
42. Optimal Page Replacement: Why is optimal page replacement considered theoretical?
Because it requires knowledge of future page references, which is typically not available in real systems.
101
42. Optimal Page Replacement: What is the first step when processing a reference string with optimal replacement?
Start with empty frames and load pages sequentially until all frames are occupied.
102
42. Optimal Page Replacement: How is the replacement decision made during a page fault?
The page that will not be used for the longest time in the future is chosen for replacement.
103
42. Optimal Page Replacement: Provide an example using a reference string with 4 frames.
For reference string [6,0,1,2,0,3,0,4,2,3,0,3,2,3], optimal replacement decisions are made based on future usage of pages.
104
42. Optimal Page Replacement: What is the approximate page fault count for the example?
For the given reference string with 4 frames, the page fault count is typically around 8.
105
106
43. LRU Page Replacement: What does LRU stand for?
LRU stands for Least Recently Used.
107
43. LRU Page Replacement: How does LRU determine which page to replace?
It tracks page access history and replaces the page that has not been used for the longest period of time.
108
43. LRU Page Replacement: What is the initial state in LRU page replacement?
The process starts with empty frames, and as pages are loaded, their usage order is recorded.
109
43. LRU Page Replacement: Explain how the usage order is updated in LRU.
When a page is accessed, its position is updated (e.g., moved to the top of a stack or its timestamp is refreshed) to indicate it is most recently used.
110
43. LRU Page Replacement: Provide an example of LRU with a reference string using 4 frames.
For reference string [6,0,1,2,0,3,0,4,2,3,0,3,2,3], pages are replaced based on the least recent access record.
111
43. LRU Page Replacement: How is the final page fault count determined in LRU?
By counting each instance of a page fault during the processing of the reference string with LRU tracking.
112
43. LRU Page Replacement: What is the typical final page fault count for the example using LRU?
For the given reference string with 4 frames, the final page fault count is typically around 6.
113
114
44. LRU Page Replacement Algorithm: What does LRU stand for in page replacement?
LRU stands for Least Recently Used, indicating that the page that has been unused the longest is replaced.
115
44. LRU Page Replacement Algorithm: What is the basic idea behind the LRU algorithm?
It replaces the page that has not been accessed for the longest period, based on historical usage.
116
44. LRU Page Replacement Algorithm: What are common methods for implementing LRU?
Common methods include a stack-based approach (maintaining an ordered list of page accesses) and a counter/timestamp-based approach.
117
44. LRU Page Replacement Algorithm: How does a stack-based LRU implementation work?
It maintains a stack where each page is moved to the top upon access, so the page at the bottom (least recently used) is replaced when needed.
118
44. LRU Page Replacement Algorithm: How does a counter-based LRU implementation work?
Each page is tagged with a timestamp, and the page with the oldest timestamp is chosen for replacement.
119
44. LRU Page Replacement Algorithm: Provide an example of LRU using a small reference string.
For a reference string like [2, 3, 2, 1] with 3 frames, LRU would update the usage order and replace the least recently accessed page when a new page is loaded.
120
44. LRU Page Replacement Algorithm: What are the advantages and disadvantages of LRU?
Advantages include a performance close to the optimal algorithm; disadvantages include higher overhead and complexity in tracking page usage.