Virtual Memory Part 1 Flashcards

1
Q

Instructions must be in ________ memory to be executed

A

physical

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

What is program size limited to?

A

Physical memory size

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

Physical memory cannot support a lot of processes. Thus ________ suffers

A

multiprogramming

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

We desire to allow some portions of the address space to be ___-_______ _________

A

non-memory resident

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

Non-memory resident means not in ______ memory

A

physical

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

What is demand paging?

A

Loading program code/data pages into memory on demand

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

An item that could be a candidate for demand paging are _____ _______

A

shared libraries

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

Swapping is when the OS stashes ______ pages away to the _____ ______ backed by stable storage

A

memory, swap space

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

Virtual memory gives the application the illusion of an ________ amount of memory

A

infinite

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

_______ memory supports more processes concurrently

A

virtual

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

What are 2 related approaches to virtual memory?

A

Swapping and demand paging

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

In demand paging, a page is brought into memory only when ______

A

needed

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

What are 3 benefits of demand paging?

A
  • Less I/O need
  • Faster response (We only load needed pages)
  • More processes admitted to the system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In demand paging, a process generates ______ (_____) addresses which are mapped to physical addresses using a ____ ____

A

logical, virtual, page table

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

In demand paging, if a requested ____ is not in memory, the _____ brings it from the hard disk

A

page, kernel

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

What is the swap space?

A

Storage space reserved for moving pages back and forth between storage and memory

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

With swap spacing, physical memory is represented in ______ and swap space is represented in ______

A

pages, blocks

18
Q

In swap spacing, ____ size equals ____ size

A

page, block

19
Q

In traditional swap spacing, _______ processes are swapped out (meaning all of its _____)

A

entire, pages

20
Q

In modern implementation of swap spacing, only _____ of processes are swapped out

A

portions

21
Q

How do we know if a page is in memory?

A

Each page table entry has a valid/present bit

22
Q

A valid/present bit of 1 means the page is _________

A

in-memory

23
Q

A valid/present bit of 0 means the page is _________

A

not-in-memory

24
Q

During an address translation, if the valid bit equals 0, what to outcomes are there?

A
  • Illegal reference (outside address space)

- Legal reference but not in memory

25
Q

If there was an illegal reference during address translation, the OS must ____ the process

A

abort

26
Q

A page fault is when the OS sets up a ____ page table entry

A

valid

27
Q

What are the 6 steps in handling a page fault?

A
1. OS figures out:
  •Invalid reference
    ➔abort process
  •Just not in memory 
    ➔bring page in
2. Locate page on disk
3. Find a free page frame
4. Swap page from disk to frame (I/O operation)
5. Reset page table, set valid bit to 1
6. Restart the instruction that caused page fault
28
Q

Virtual memory allows faster/efficient process creation using ________________

A

copy-on-write (COW)

29
Q

What does copy-on-write allow?

A

COW allows both parent and child processes to initially share the same pages in memory (during fork())

30
Q

During COW, if either _______ or _____ process modifies a shared page, the page is ______-

A

parent, child, copied

31
Q

A Major Page fault means the page needs to be brought from ____

A

disk

32
Q

A major Page fault is __________ and includes ___

A

expensive, I/O

33
Q

A Minor Page fault not need to bring a page from ______

A

disk

34
Q

A Minor Page fault is typically very _______ and just _______ the page table

A

fast, updates

35
Q

Shared pages already in memory that are ____ _________ with the process address space is an example of a _____ page fault

A

not linked, minor

36
Q

Malloc-ing where the ______ may not actually allocate physical memory until it is ________ is an example of a ______ page fault. This can become a ________

A

kernel, accessed, minor, bottleneck

37
Q

What does the command “ps -eomin_flt,maj_flt,pid,cmd” do?

A

Prints minor and major page faults for all (-e) processes running in the system with the format (-o) specified

38
Q

Which linux command reports information about processes, memory paging, IO, traps, etc?

A

vmstat

39
Q

Which linux command displays page size?

A

getconf PAGESIZE

40
Q

What does the command “sync; /bin/echo 3 > /proc/sys/vm/drop_caches;” do?

A

Clears OS caches, but it needs sudo or root privileges