Memory Management 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 increases
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

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
7
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
8
Q

________ allows the parent and child processes to initially share the same pages, but when either process modifies a page, a copy of the shared page is created.
A) copy-on-write
B) zero-fill-on-demand
C) memory-mapped
D) virtual memory fork

A

A- COPY-ON-WRITE

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

_____ is the algorithm implemented on most systems. (for page fault)
A) FIFO
B) Least frequently used
C) Most frequently used
D) LRU
~~~

A

D- LRU

LRU stands for Least Recently Used. As the name suggests, this algorithm is based on the strategy that whenever a page fault occurs, the least recently used page will be replaced with a new page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
. \_\_\_\_\_ occurs when a process spends more time paging than executing.
A) Thrashing
B) Memory-mapping
C) Demand paging
D) Swapping
A

A- THRASHING

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

Windows uses a local page replacement policy _____.
A) when a process exceeds its working set minimum
B) when a process exceeds its working set maximum
C) when the system undergoes automatic working set trimming
D) under all circumstances

A

B- WHEN A PROCESS EXCEEDS ITS WORKING SET MAXIMUM

Explanation for C:
When a system undergoes automatic working set trimming, it means that the operating system or a memory management component dynamically adjusts the working set of a process to optimize memory usage and system performance.

The working set of a process refers to the subset of its pages that are actively used to access during a specific time period. It represents the set of pages that the process requires to execute efficiently without incurring excessive page faults.

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

Which of the following statements is false with regard to Solaris memory management?
A) The speed at which pages are examined (the scanrate) is constant.
B) The pageout process only runs if the number of free pages is less than lotsfree.
C) An LRU approximation algorithm is employed.
D) Pages selected for replacement may be reclaimed before being placed on the free list.

A

A- THE SPEED AT WHICH PAGES ARE EXAMINED (THE SCANRATE) IS CONSTANT

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

Which of the following statements is false with regard to allocating kernel memory?
A) Slab allocation does not suffer from fragmentation.
B) Adjacent segments can be combined into one larger segment with the buddy system.
C) Because the kernel requests memory of varying sizes, some of which may be quite small, the system does not have to be concerned about wasting memory

A

C

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

The _____ is an approximation of a program’s locality.
A) locality model
B) working set
C) page fault frequency
D) page replacement algorithm

A

B- WORKING SET

Working set: set of actively used resources or data elements in a program or system at a given point in time.

Program locality refers to the tendency of a program to access certain data or instructions more frequently or in a clustered manner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
\_\_\_\_\_\_ allows a portion of a virtual address space to be logically associated with a file.
A) Memory-mapping
B) Shared memory
C) Slab allocation
D) Locality of reference
A

A- MEMORY MAPPING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
Systems in which memory access times vary significantly are known as \_\_\_\_\_\_\_\_\_\_.
A) memory-mapped I/O
B) demand-paged memory
C) non-uniform memory access
D) copy-on-write memory
A

C- NON-UNIFORM MEMORY ACCESS

17
Q

Which of the following is considered a benefit when using the slab allocator?
A) Memory is allocated using a simple power-of-2 allocator.
B) It allows kernel code and data to be efficiently paged.
C) It allows larger segments to be combined using coalescing.
D) There is no memory fragmentation.

A

D- THERE IS NO MEMORY FRAGMENTATION

Slab allocation is a memory management technique that offers benefits such as reduced fragmentation, improved memory locality, faster allocation and deallocation, efficient object management, caching, and scalability. It achieves these advantages by allocating memory in fixed-size slabs, allowing for efficient reuse and caching of memory blocks. Slab allocation is commonly used in operating systems and resource-intensive applications for efficient memory management.

18
Q

Systems in which memory access times vary significantly are known as __________.

Select one:

a. memory-mapped I/O
b. demand-paged memory
c. non-uniform memory access
d. copy-on-write memory

A

C- NON UNIFORM MEMORY ACCESS

19
Q

An address generated by a CPU is referred to as a ____.

Select one:

a. physical address
b. logical address
c. post relocation register address
d. memory management unit (MMU) generated address

A

B- LOGICAL ADDRESS

The MMU translates virtual addresses generated by the CPU into physical addresses. Virtual memory allows processes to use more memory than is physically available by utilizing secondary storage (e.g., hard disk) as an extension of the main memory.

20
Q

_____ is the dynamic storage allocation algorithm that results in the smallest leftover hole in memory.

Select one:

a. First-fit
b. Best-fit
c. Worst-fit
d. None of the above

A

B- BEST FIT

21
Q

_____ is the method of binding instructions and data to memory performed by most general-purpose operating systems.

Select one:

a. Interrupt binding
b. Compile time binding
c. Execution time binding
d. Load time binding

A

C- EXECUTION TIME BINDING

Execution time binding, also known as dynamic binding or late binding, refers to the process of determining the actual implementation or address of a function or method at runtime rather than at compile-time. It allows for the resolution of function calls or method invocations to be deferred until the program is executing.

Compared to compile-time binding or static binding, where the binding between function calls and implementations is determined during the compilation phase, execution time binding provides more flexibility and extensibility at the cost of some performance overhead due to the dynamic dispatch process.

The dynamic dispatch process, also known as dynamic method dispatch or runtime polymorphism, refers to the mechanism by which the appropriate implementation of a polymorphic method is determined and executed at runtime based on the actual type of the object being referenced.

Virtual Function Table (vtable): In languages like C++ and Java, a virtual function table, also known as a vtable, is used to store the addresses of the overridden methods for each class in the hierarchy. Each object of a class with virtual methods contains a hidden pointer to its corresponding vtable.

22
Q

_____ is the dynamic storage allocation algorithm that results in the largest leftover hole in memory.

Select one:

a. First-fit
b. Best-fit
c. Worst-fit
d. None of the above

A

C- WORST FIT

23
Q

Optimal page replacement ____.

Select one:

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

Optimal page replacement, also known as the OPT algorithm or clairvoyant algorithm, is an idealized page replacement algorithm that selects the page for eviction based on future knowledge of memory references. It assumes perfect knowledge of which pages will be accessed in the future and selects the page that will be used farthest in the future for replacement. Optimal page replacement provides the lowest possible number of page faults but is impractical to implement in real systems because it requires knowledge of future memory references. It is often used as a benchmark for evaluating other page replacement algorithms.

Belady’s anomaly highlights that the behavior of page replacement algorithms is not always predictable and can be counterintuitive. It implies that simply increasing the number of page frames may not always lead to better performance in terms of reducing page faults.

24
Q

What size segment will be allocated for a 39 KB request on a system using the buddy system for kernel memory allocation?

Select one:

a. 39 KB
b. 42 KB
c. 64 KB
d. none of the above

A

C- 64 Kb

In the buddy system, memory is allocated in powers of 2.

25
Q

Which of the following data structures is appropriate for placing into its own segment?

Select one:

a. heap
b. kernel code and data
c. user code and data
d. all of the above

A

D- ALL OF THE ABOVE

1.	Memory Isolation: Placing a data structure in its own segment can provide memory isolation and separation from other parts of the system. This isolation can help prevent unauthorized access or modification by restricting access permissions to the segment. It enhances security and protects critical data or code from being compromised.
2.	Access Control: Allocating a data structure in a separate segment allows for more granular access control. Access permissions and protections can be defined specifically for that segment, allowing fine-grained control over who can read, write, or execute the data structure. This is particularly important for sensitive data or critical system code that requires strict access restrictions.
3.	Memory Protection: By placing a data structure in its own segment, memory protection mechanisms can be applied to that segment. This allows the system to detect and handle illegal memory accesses, such as buffer overflows or invalid memory operations. Memory protection helps ensure the stability and reliability of the system by preventing memory corruption caused by faulty code or malicious attacks.
4.	Performance Optimization: Allocating a data structure in its own segment can help optimize performance. For example, if the data structure requires fast and efficient access, it can be placed in a separate segment with specific memory attributes or caching settings that are optimized for its access patterns. This can result in improved cache utilization, reduced contention, and faster access times.
26
Q

Which of the following statements is true with respect to hashed page tables?

Select one:

a. They only work for sparse address spaces.
b. The virtual address is used to hash into the hash table.
c. They are a common approach for handling address spaces larger than 32 bits.
d. Hash table collisions do not occur because of the importance of paging.

A

C- THEY ARE A COMMON APPROACH FOR HANDLING ADDRESS SPACES LARGER THAN 32 BITS

A hashed page table is a data structure used in operating systems to efficiently map virtual addresses in a computer’s memory management system.

27
Q

The ____ is the number of entries in the TLB multiplied by the page size.

Select one:

a. TLB cache
b. page resolution
c. TLB reach
d. hit ratio

A

C- TLB REACH

(Translation Lookaside Buffer) reach, refers to the ability of the TLB to effectively translate virtual addresses to physical addresses in a computer’s memory hierarchy.

28
Q

A(n) ____ page table has one page entry for each real page (or frame) of memory.

Select one:

a. inverted
b. clustered
c. forward-mapped
d. virtual

A

A- INVERTED

Unlike a traditional page table, which is typically implemented as an array or hash table, an inverted page table flips the structure around by indexing the table entries based on physical memory frames rather than virtual memory pages.

29
Q

Belady’s anomaly states that ____.

Select one:

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 increases
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

30
Q

With segmentation, a logical address consists of _____.

Select one:

a. segment number and offset
b. segment name and offset
c. segment number and page number
d. segment table and segment number

A

A- SEGMENT NUMBER AND OFFSET

  1. Segment Number: It represents the identification number assigned to a particular segment within a segmented memory model. In a segmented memory model, memory is divided into fixed-size segments, and each segment is assigned a unique number. The segment number is used to access or reference a specific segment within the memory model.
  2. Offset: It refers to the distance or displacement from the beginning of a segment to a specific location within that segment. The offset is typically expressed in bytes and indicates the position of a particular data or instruction within the segment. It helps determine the precise memory address of the desired location by combining the segment number and offset values.
31
Q

In systems that support virtual memory, ____.

Select one:

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

The logical address is used as a reference to access the physical address.

Logical memory refers to the abstract view of memory that a process has.

Virtual memory is a memory management technique that provides an illusion of a larger memory space than what is physically available.

32
Q

_____ occurs when a process spends more time paging than executing.

Select one:

a. Thrashing
b. Memory mapping
c. Demand paging
d. Swapping

A

A- THRASHING

When the virtual memory of a computer is rapidly exchanging data for data on hard disk, to the exclusion of most application-level processing

The OS is swapping things in and out (of RAM) as needed. When this swapping activity is occurring such that it is the major consumer of the CPU time, then you are effectively thrashing.