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.

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.

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.

19
Q

T OR F:

Virtual memory decreases the degree of multiprogramming in a system.

A

FALSE

20
Q

T OR F:

Stack algorithms can never exhibit Belady’s anomaly.

A

TRUE

21
Q

T OR F:

If the page-fault rate is too high, the process may have too many frames.

A

FALSE

22
Q

T OR F:

Using the buddy system for allocating kernel memory is very likely to cause fragmentation within the allocated segments

A

TRUE

23
Q

T OR F:

Windows XP implements virtual memory using demand paging with clustering

A

TRUE