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

Memory Management Questions and Answers

Answer: D

Correct answer: for every two allocated blocks, about one block is lost to fragmentation

The 50-per-cent rule is a statistical result about first-fit allocation: given \( N \) allocated blocks, about \( 0.5N \) blocks are lost to external fragmentation, so roughly a third of memory may be unusable. It is derived from the observation that in a steady state, requests and releases interleave in a way that leaves a hole beside about half the allocated blocks. The rule is empirical rather than exact, but it is a good guide to what contiguous allocation costs. Its practical significance is that it quantifies why paging is preferred. A third of memory unusable is a heavy price, and paging removes external fragmentation entirely, since any free frame will serve for any page. The remaining waste under paging is internal fragmentation of at most one page per process - on average half a page, which for a 4 KB page is 2 KB. Against a third of memory, that is negligible. Compaction is the alternative cure, but it costs a great deal of copying.

Please log in or register to report this question.

Answer: C

Correct answer: a page number and an offset within the page

A logical address in a paged system splits into a page number and an offset. The page number indexes the page table to yield a frame number; the offset is carried through unchanged and appended to it to give the physical address. The split is determined by the page size, which is a power of two. With a page size of \( 2^{n} \) bytes, the low \( n \) bits are the offset and the rest are the page number. That is precisely why page sizes are powers of two: the division needs no arithmetic at all, only a partition of the bits. A 32-bit address with 4 KB pages therefore gives a 12-bit offset and a 20-bit page number, allowing a million pages. The choice of page size is a trade-off. Larger pages mean smaller page tables and fewer faults for sequential access, but more internal fragmentation and more wasted transfer. Most systems settle on 4 KB, with support for larger pages where a workload benefits.

Please log in or register to report this question.

154.

A program which interprets each line of high level program at time of execution is called

Answer: D

Correct answer: interpreter

An interpreter translates and executes one statement at a time as the program runs, which is why an interpreted program can be changed and tried again at once but runs more slowly.

Please log in or register to report this question.

155.

Programming language which is extension of programming language 'BASIC' is

Answer: B

Correct answer: COMAL

COMAL was built on BASIC, adding the structured constructs of Pascal while keeping BASIC's accessibility.

Please log in or register to report this question.

Answer: B

Correct answer: it helps to reduce the size of page table needed to implement the virtual address space of a process

A single-level table needs an entry for every page whether or not it is used, which for a large address space is enormous. A multilevel table pages the table itself, so only the parts actually in use need exist. It does not make access faster - each level is another memory reference.

Please log in or register to report this question.

Answer: C

Correct answer: a cache of recent page-table entries used to speed up address translation

The TLB is a small, fast associative cache holding recently used page-table entries. It exists to solve a specific problem: without it, every memory reference would need two accesses - one to read the page table and one to fetch the data - halving effective speed. On a TLB hit the frame number is available immediately and only one memory access is needed. On a miss the page table is consulted and the entry is loaded into the TLB, displacing another. Hit rates above 90 per cent are typical because of locality of reference, which brings the effective access time close to that of a single access. It is small - often only tens to a few hundred entries - because associative lookup is expensive in hardware. A context switch is a complication: entries belonging to the old process must not be used by the new one, so the TLB is either flushed or its entries tagged with an address-space identifier. Flushing is why a context switch costs more than it first appears.

Please log in or register to report this question.

Answer: A

Correct answer: first fit, best fit, worst fit

First fit stops at the first hole large enough, so it examines fewer holes than the other two, which must scan the whole list to find the smallest or the largest. In storage utilisation first fit and best fit are close, but in speed first fit wins.

Please log in or register to report this question.

Answer: A

Correct answer: share pages until one of them writes, at which point the page is duplicated

Copy-on-write lets a newly created process share its parent’s pages, marking them read-only. Only when one of the two attempts to write is the page duplicated, and only that page. The saving is large. Creating a process by copying the whole address space is expensive, and it is usually wasted: on Unix systems a fork is very often followed immediately by an exec, which replaces the address space entirely. Copy-on-write makes process creation nearly free in that common case. The mechanism is a page fault. The shared pages are marked read-only in both page tables; a write raises a protection fault; the operating system recognises the page as copy-on-write, allocates a free frame, copies the contents, and marks the new page writable for the faulting process. Pages never written are never copied, so a large shared library or a read-only data segment costs nothing. The same technique is used for memory-mapped files and for snapshots in file systems and virtual machines.

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