Machine-translated by Google. Questions are authored in English.
Top

Memory Management Questions and Answers

Answer: C

Correct answer: It replaces the page that has been in memory the longest

FIFO replaces the page that has been resident longest, regardless of how recently or how often it has been used. It is implemented with a simple queue, so its cost is trivial. That simplicity is its only merit. Age of loading is a poor predictor of future need - a heavily used page loaded early is evicted while a rarely touched recent one survives - so its fault rate is markedly worse than LRU’s. It also suffers Belady’s anomaly: increasing the number of frames can increase the number of faults, which the third option denies. Algorithms free of the anomaly are the stack algorithms, of which LRU and the optimal algorithm are examples. The fourth option describes true LRU, which needs a timestamp or stack updated on every reference and is too expensive in practice. FIFO is rarely used unmodified. Adding a reference-bit check produces the second-chance or clock algorithm, which costs almost nothing more and approximates LRU well.

Please log in or register to report this question.

152.

The effective access time in a demand-paged system depends mainly on

Answer: A

Correct answer: the page-fault rate

Effective access time is dominated by the page-fault rate, because the two costs involved differ by so many orders of magnitude. A memory access takes on the order of 100 nanoseconds; servicing a page fault takes several milliseconds, since it requires a disk transfer. The relation is \[ \text{EAT} = (1-p) \times t_{m} + p \times t_{f}, \] where \( p \) is the fault rate. With a memory time of 100 ns and a fault time of 8 ms, a fault rate of just one in a thousand gives an effective time of about 8 microseconds - eighty times slower than memory alone. That arithmetic is why the fault rate must be kept extraordinarily low, of the order of one in a million, for demand paging to be worthwhile, and why locality of reference is essential to the whole scheme. It is also why thrashing is catastrophic rather than merely slow, and why replacement algorithms are studied so closely.

Please log in or register to report this question.

Answer: C

Correct answer: a process references a page that is not currently in physical memory

A page fault is raised when a process references a page whose valid bit in the page table indicates it is not resident in physical memory. Servicing it follows a fixed sequence: the hardware traps to the operating system, which checks that the reference is legal, finds a free frame or selects a victim to evict, writes the victim back if it is dirty, reads the required page in from the backing store, updates the page table, and restarts the instruction that faulted. It is not an error, despite the name. Demand paging depends on page faults as its ordinary mechanism, and a process starts with none of its pages resident, faulting them in as it runs. The cost is what matters: a memory access takes nanoseconds and a disk access milliseconds, so the effective access time is dominated by the fault rate. A rate of one in a hundred thousand can still double the average access time, which is why locality of reference is essential to the scheme working at all.

Please log in or register to report this question.

Answer: D

Correct answer: the page is in the process’s address space and currently in memory

The valid-invalid bit records whether a page-table entry refers to a page that is legally part of the process’s address space and currently resident in physical memory. Marked invalid, any reference to it traps to the operating system. The trap has two possible meanings, and the operating system must distinguish them. Either the reference is genuinely illegal - outside the address space - in which case the process is terminated with an addressing error; or the page is legal but not resident, in which case it is a page fault and the page is brought in from the backing store. The kernel keeps a separate record of which pages a process is entitled to in order to tell the two apart. The other bits in an entry serve different purposes: the dirty bit records modification, so a clean page need not be written back; the reference bit supports clock and second-chance replacement; and protection bits mark a page read-only or execute-only. Demand paging works by starting every page marked invalid.

Please log in or register to report this question.

156.

Modems are configured in such a manner that any incoming calls are automatically answered. Manufacturer provides inbuilt modems in many user computers. In this case the greatest security risk when dealing with the modems is

Answer: B

Correct answer: Remote access without the knowledge of network administrator

A modem set to answer automatically gives anyone who dials it a way into the machine, and through it into the network, that bypasses the firewall and every other perimeter control. Because it is inside the network and unrecorded, the administrator has no way of knowing the door exists.

Please log in or register to report this question.

Answer: D

Correct answer: segments are variable in size and correspond to logical divisions of a program

Segmentation divides a program along its logical lines - code, data, stack, individual procedures, arrays - so segments vary in size. Paging divides memory into fixed-size blocks with no regard to program structure. A segmented address is a pair: a segment number and an offset within it. The segment table gives a base address and a limit, and the hardware checks the offset against the limit - which is how a segmentation fault is detected. The trade-off follows from the sizes. Because segments are variable, segmentation suffers external fragmentation but no internal; because pages are fixed, paging suffers internal but no external. Segmentation’s advantage is that protection and sharing are natural: a whole segment can be marked read-only or execute-only, and a shared library becomes one segment mapped into several processes. Paging cannot express that as cleanly, since a page has no logical meaning. Many systems combine the two, paging each segment.

Please log in or register to report this question.

Answer: B

Correct answer: fixed-size blocks called frames

Physical memory is divided into fixed-size blocks called frames, and logical memory into blocks of the same size called pages. A page is loaded into any available frame, and the page table records which. Keeping the two the same size is what makes the scheme work: any page fits any frame, so allocation never fails for want of a suitably sized hole, and external fragmentation disappears entirely. The terminology is worth being exact about, since examiners rely on it: pages are logical and frames are physical. The size is a power of two, typically 4 KB. The residual waste is internal fragmentation in the last page of each process, averaging half a page - a far smaller cost than the third of memory that external fragmentation can consume under contiguous allocation. The second option describes segmentation, which divides memory along logical lines into variable-size pieces and therefore suffers external fragmentation instead.

Please log in or register to report this question.

Answer: A

Correct answer: only when it is referenced

Demand paging loads a page only when it is actually referenced. A process begins with none of its pages resident and faults them in as it runs, which is the lazy swapper principle: never bring in a page that may not be needed. The benefits are substantial. Program startup is faster, since only the first few pages are read; less input and output is performed overall, because parts of a program never executed are never loaded; and more processes fit in memory at once, raising CPU utilisation. The alternative, prepaging, brings in a group of pages in anticipation. It reduces the number of faults if the guesses are right and wastes input and output if they are wrong, so it is used selectively - typically when a swapped-out process resumes and its working set is already known. Demand paging works only because of locality of reference: programs concentrate their accesses in small regions, so the fault rate settles low after an initial burst.

Please log in or register to report this question.

Loading…
Tags: Memory Management Questions and Answers || Memory Management MCQ Questions and Answers || Memory Management GK Questions and Answers || Memory Management GK MCQ Questions || Memory Management Multiple Choice Questions and Answers || Memory Management GK || GK on Memory Management || Computer Awareness Questions and Answers || Computer Awareness MCQ Questions and Answers || Computer Awareness GK Questions and Answers || GK on Computer Awareness