Virtual Memory Flashcards

1
Q

Virtual Memory?

A

Code needs to be in memory to execute, but entire program rarely used.

Entire program code not needed at the same time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Virtual Memory Definition?

A

Separation of user logical memory from physical memory.

Only part of the program needs to be in memory for execution
Logical address space can therefore be much larger than physical address space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Virtual address space

A

Logical view of how process is stored in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Demand Paging?

A

Could bring entire process into memory at load time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Lazy swapper?

A

Never swaps a page into memory unless page will be needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Valid-Invalid Bit?

A

v -> in memory - memory resident

i -> not-in-memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Page-Fault?

A

If there is a reference to a page, first reference to that page will trap to operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Steps of Page Fault?

A
  1. Operating System looks at another table to decide
  2. Find free frame
  3. Swap page into frame via scheduled disk operation
  4. Reset tables to indicate page now in memory
  5. Restart the instruction that caused the page fault
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Page Replacement?

A

Prevent over-allocation of memory by modifying page fault service routine to include page replacement.

Use modify bit to reduce overhead of page transfers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Basic Page Replacement steps?

A
  1. Find the location of the desired page on a disk
  2. Find a free frame
  3. Bring the desired page into the newly free frame, update the page and frame tables.
  4. Continue the process by restarting the instruction that caused the trap
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Frame Allocation Algorithm?

A

Determines
How many frames to give each process
Which frames to replace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Page-Replacement Algorithm

A

Want lowest page fault rate on both first access and re-access

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Secondary Chance Algorithms consist of?

A

Reference Bit

Second-Chance Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Counting Algorithms?

A

Keep a counter of the number of references that have been made to each page.
Not common
Expensive to implement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Lease Frequently Used Algorithm?

A

Replaces page with smallest count

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Most Frequently Used Algorithm?

A

Based on the argument that the page with smallest count was probably just brought in and has yet to be used.

17
Q

Global Replacement?

A

Process selects a replacement frame from the set of all frames. One process can take a frame from another.

18
Q

Local Replacement?

A

Each process selects from only its own set of allocated frames.
More consistent
But possibly underutilized memory

19
Q

Thrashing?

A

If a process does not have enough pages, the page-fault rate is very high

Page fault to get page
Replace Existing frame

20
Q

Thrashing leads to?

A

Low CPU utilization

OS thinking that it needs to increase the degree of multiprogramming.