Chapter 8: Virtual Memory Flashcards

1
Q

Which of the following is a benefit of allowing a program that is only partially in memory to execute?
A) Programs can be written to use more memory than is available in physical memory.
B) CPU utilization and throughput is increased.
C) Less I/O is needed to load or swap each user program into memory.
D) All of the above

A

D- ALL OF THE ABOVE

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

In systems that support virtual memory, ____.
A) virtual memory is separated from logical memory.
B) virtual memory is separated from physical memory.
C) physical memory is separated from secondary storage.
D) physical memory is separated from logical memory.

A

D- PHYSICAL MEMORY IS SEPARATED FROM LOGICAL MEMORY

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

The vfork() system call in UNIX ____.
A) allows the child process to use the address space of the parent
B) uses copy-on-write with the fork() call
C) is not intended to be used when the child process calls exec() immediately after creation
D) duplicates all pages that are modified by the child process

A

A- ALLOWS THE CHILD PROCESS TO USE THE ADDRESS SPACE OF THE PARENT

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

Belady’s Anomaly states that ____.
A) giving more memory to a process will improve its performance
B) as the number of allocated frames increases, the page-fault rate may decrease for all page replacement algorithms
C) for some page replacement algorithms, the page-fault rate may decrease as the number of allocated frames increase
D) for some page replacement algorithms, the page-fault rate may increase as the number of allocated frames increases

A

D- FOR SOME PAGE REPLACEMENT ALGORITHMS, THE PAGE FAULT RATE MAY INCREASE AS THE NUMBER OF ALLOCATED FRAMES INCREASES

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

Optimal page replacement ____.
A) is the page-replacement algorithm most often implemented.
B) is used mostly for comparison with other page-replacement schemes.
C) can suffer from Belady’s anomaly.
D) requires that the system keep track of previously used pages.

A

B- IS USED MOSTLY FOR COMPARISON WITH OTHER PAGE-REPLACEMENT SCHEMES

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

In the enhanced second chance algorithm, which of the following ordered pairs represents a page that would be the best choice for replacement?
A) (0,0) B) (0,1) C) (1,0) D) (1,1)

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
The \_\_\_\_\_ allocation algorithm allocates available memory to each process according to its size.
A) equal 
B) global 
C) proportional 
D) slab
A

C- PROPORTIONAL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
The \_\_\_\_ is the number of entries in the TLB multiplied by the page size.
A) TLB cache 
B) page resolution 
C) TLB reach 
D) hit ratio
A

C- TLB REACH

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

What is the benefit of using sparse addresses in virtual memory?

A

Virtual address spaces that include holes between the heap and stack are known as sparse address spaces. Using a sparse address space is beneficial because the holes can be filled as the stack or heap segments grow or if we wish to dynamically link libraries (or possibly other shared objects) during program execution.

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

Compare a demand paging system with a paging system with swapping.

A

A demand-paging system is similar to a paging system with swapping where processes reside in secondary memory. With demand paging, when we want to execute a process, we swap it into memory. Rather than swapping the entire process into memory, however, we use a lazy swapper. A lazy swapper never swaps a page into memory unless that page will be needed. So a swapper manipulates entire processes, whereas a demand pager is concerned with the individual pages of a process.

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

Explain the sequence of events that happen when a page-fault trap occurs.

A

When the operating system cannot load the desired page into memory, the page-fault trap occurs. First, the memory reference is checked for validity. In the case of an invalid request, the program will be terminated. If the request was valid, a free frame is located. A disk operation is then scheduled to read the page into the frame just found and use the page accordingly.

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

How is the effective access time computed for a demand-paged memory system?

A

In order to compute the effective access time, we need to know the average memory access time of the system, the probability of a page fault, and the time necessary to service a page fault. The effective access time can then be computed using the formula: effective access time = (1-probability of page fault) * memory access time + probability of page fault * page fault time.

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

. How does the second-chance algorithm for page replacement differ from the FIFO page replacement algorithm?

A

The second-chance algorithm is based on the FIFO replacement algorithm and even degenerates to FIFO in its worst case scenario. In this algorithm, a FIFO replacement is implemented along with a reference bit. If the reference bit is set, then we clear the bit, the page’s arrival time is set to the current time, and we move along in a similar fashion through the pages until a page with a cleared reference bit is found and subsequently replaced.

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

Explain the concept behind prepaging.

A

Paging schemes such as pure demand paging result in large amounts of initial page faults as the process is started. Prepaging is an attempt to prevent this high level of initial paging by bringing into memory, at one time, all of the pages that will be needed by the process

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

Why doesn’t a local replacement algorithm solve the problem of thrashing entirely?

A

With local replacement, if one process starts thrashing, it cannot steal frames from another process and cause the latter to thrash as well. However, if processes are thrashing, they will be in the queue for the paging device most of the time. The average service time for a page fault will increase because of the longer average queue for the paging device. Thus, the effective access time will increase even for a process that is not thrashing.

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

Explain the difference between programmed I/O (PIO) and interrupt driven I/O.

A

To send out a long string of bytes through a memory-mapped serial port, the CPU writes one data byte to the data register to signal that it is ready for the next byte. If the CPU uses polling to watch the control bit, constantly looping to see whether the device is ready, this method of operation is called programmer I/O. If the CPU does not poll the control bit, but instead receives an interrupt when the device is ready for the next byte, the data transfer is said to be interrupt driven.

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

What are the benefits of using slab allocation to allocate kernel memory?

A

The slab allocator provides two main benefits. First, no memory is wasted due to fragmentation. When the kernel requests memory for an object, the slab allocator returns the exact amount of memory required to represent the object. Second, memory requests can be satisfied quickly. Objects are created in advance and can be quickly allocated. Also, released objects are returned to the cache and marked as free, thus making them immediately available for subsequent requests.

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

How are lock bits useful in I/O requests?

A

A lock bit is associated with every frame. If a frame is locked, it cannot be selected for replacement. To write a block on tape, we lock into memory the pages containing the block. The system then continues as usual with other processes if the I/O request is in a queue for that I/O device. This avoids the replacement of the pages for other processes and the possible unavailability of those pages when the I/O request advances to the head of the device queue. When the I/O is complete, the pages are unlocked.

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

Virtual memory decreases the degree of multiprogramming in a system. (T/F)

A

FALSE

20
Q

Stack algorithms can never exhibit Belady’s anomaly. (T/F)

A

TRUE

21
Q

If the page-fault rate is too high, the process may have too many frames. (T/F)

A

FALSE

22
Q

Using the buddy system for allocating kernel memory is very likely to cause fragmentation within the allocated segments (T/F)

A

TRUE

23
Q

Windows XP implements virtual memory using demand paging with clustering (T/F)

A

TRUE

24
Q

Virtual memory (VM) is a

A

collection of one or more logical address spaces, each of which may exceed the size of physical memory.

25
Q

Demand paging is the principle of

A

loading a page into memory only when the page is needed, rather than at the start of the execution.

26
Q

A present bit is a

A

binary flag in each page table entry that indicates whether the corresponding page is currently resident in memory.

27
Q

A page fault is an

A

interrupt that occurs when a program attempts to reference a non-resident page.

28
Q

In the context of computer memory management, a non-resident page refers to a page or portion of a program or data that is

A

not currently loaded into the main memory (RAM) but instead resides in secondary storage, such as a hard disk drive (HDD) or solid-state drive (SSD).

29
Q

Page replacement is the act of

A

overwriting a page in memory with a different page loaded from the disk when needed.

30
Q

A modified-bit (m-bit) is a

A

binary flag in each page table entry that indicates whether the corresponding page has been modified during execution.

31
Q

A reference string is

A

the sequence of page numbers referenced by an executing program during a given time interval.

32
Q

The optimal page replacement algorithm selects the page that

A

will not be referenced for the longest time in the future.

33
Q

The FIFO page replacement algorithm selects the page that

A

has been resident in memory for the longest time.

34
Q

The least-recently-used page replacement algorithm (LRU) selects the page that

A

has not been referenced for the longest time.

35
Q

A referenced bit (r-bit) is a bit associated with

A

a page and is set automatically by the hardware whenever the page is referenced by any instruction.

36
Q

An aging register is associated with a page and is

A

shifted periodically to the right by 1 bit. Unless the most significant bit is set to 1, the page is aging in the sense that the associated register value is steadily decreasing.

37
Q

The aging page replacement algorithm does not maintain pages sorted in the exact LRU order, but

A

groups together pages referenced during a period of d consecutive references.

38
Q

Is a coarse-grain approximation of LRU, which divides pages into 4 categories based on the 4 possible combination of the r- bit and the m-bit.

A

The third-chance page replacement algorithm, also known as the not-recently-used page replacement algorithm (NRU).

39
Q

The optimal working set of a process is the set of

A

resident pages that will still be needed in the immediate future and thus should remain resident.

40
Q

A non-resident page refers to a page or portion of a program or data that is not

A

currently loaded into the main memory (RAM) but instead resides in secondary storage, such as a hard disk drive (HDD) or solid-state drive (SSD)

41
Q

The working set (WS) of a process at time t __________

The working set page replacement algorithm uses a __________

A

is the set of pages referenced during the past d memory operations preceding t.

trailing window of size d superimposed on the RS to determine the size and composition of the working set at time t.

42
Q

The page-fault-frequency replacement algorithm takes a direct approach to controlling the page fault rate by

A

adjusting the current resident set based on how frequently consecutive page faults occur.

43
Q

Page fault rate is the number of page faults, f, occurring during a

A

number of memory references, t. The page fault rate can be expressed as P = f/t, where 0 ≤ P ≤ 1.
P = 1 means that every memory reference results in a page fault, and P = 0 means that no page faults occur.

44
Q

Effective access time is

A

the average time to access memory in the presence of page faults.
The effective access time, E, depends on the frequency of page faults:
E=(1-P) * m + S * P
where m is the time to access physical memory and S is the time to process a page fault.

45
Q

Load control is the activity of

A

determining how many processes should be running concurrently at any given time to maximize overall system performance.