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

Memory Management Questions and Answers

211.

In a paged memory, the page hit ratio is 0.35. The required to access a page in secondary memory is equal to 100 ns. The time required to access a page in primary memory is 10 ns. The average time required to access a page is :

Answer: C

Correct answer: 68.5 ns

With a hit ratio of 0.35, the page is found in primary memory 35 per cent of the time and must be fetched from secondary memory otherwise:

\[ 0.35\times 10 + 0.65\times 100 = 3.5 + 65 = 68.5\ \text{ns} \]

Please log in or register to report this question.

Answer: B

Correct answer: a process spends more time paging than executing

Thrashing is the state in which a process spends more time servicing page faults than doing useful work. It arises when a process has too few frames to hold its working set - the pages it is actively using - so each reference evicts a page that will be needed almost immediately. What makes it pathological is the feedback loop. The operating system sees low CPU utilisation and concludes that more processes should be admitted; that reduces the frames available to each; more page faults follow; utilisation falls further. Throughput collapses rather than degrading gracefully. The remedies attack the cause rather than the symptom. The working set model allocates each process enough frames for the pages it has referenced in a recent window, suspending processes that cannot be given enough. Page-fault frequency control adjusts allocation directly, adding frames when the fault rate rises and removing them when it falls. Simply adding physical memory also helps, which is why thrashing is far less common than it was.

Please log in or register to report this question.

Answer: D

Correct answer: FIFO order, but a page with its reference bit set is spared and the bit cleared

The second-chance algorithm is FIFO with one modification. When a page reaches the head of the queue, its reference bit is examined: if the bit is 0 the page is replaced, and if it is 1 the bit is cleared and the page is given another chance, moving to the back of the queue as though newly loaded. Implemented as a circular queue with a pointer sweeping round it, this is known as the clock algorithm, and the pointer is the clock hand. Its purpose is to approximate LRU at almost no cost. True LRU needs a timestamp or a stack updated on every memory reference, which is too expensive; the reference bit is set by hardware for free, and one bit is enough to distinguish pages used recently from pages not used at all. An enhanced version considers the dirty bit as well, preferring to evict pages that are both unreferenced and unmodified, since those need no write-back. Most real operating systems use some variant of it.

Please log in or register to report this question.

214.

Sequence of instructions that are carried out for a particular task is classified as

Answer: A

Correct answer: routine

A sequence of instructions carried out for a particular task is a routine. Functions, procedures and subroutines are particular kinds of routine.

Please log in or register to report this question.

215.

What term is used if a search engine returns a web page if a match is found?

Answer: A

Correct answer: Hit

Each matching page a search engine returns is a hit. A link is what a page contains and a blog is a kind of site.

Please log in or register to report this question.

216.

Programming language which is used for scientific purposes and work is to be done in batches is

Answer: D

Correct answer: FORTRAN

FORTRAN was designed for numerical scientific work, and such work has traditionally been submitted as batch jobs rather than run interactively. LOGO, COMAL and Pascal are teaching languages.

Please log in or register to report this question.

Answer: B

Correct answer: equal or proportional allocation according to process size

Frames are distributed among processes chiefly by equal allocation, dividing them evenly, or proportional allocation, giving each process a share according to its size. Equal allocation is simple but wasteful: a small process receives frames it cannot use while a large one starves. Proportional allocation is better, though it takes no account of priority - a variation weights the shares by priority as well as size. A second, orthogonal distinction is between local and global replacement. Under local replacement a process may only take a frame from its own allocation, so its performance is predictable and unaffected by others; under global replacement it may take a frame from any process, which uses memory better overall but means a process’s fault rate depends on the behaviour of its neighbours. Global is more common in practice. Neither scheme prevents thrashing by itself. That requires the working set model or page-fault frequency control, which adjust allocation according to what each process is actually referencing.

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: D

Correct answer: can be loaded and run at any address in memory

A relocatable program can be placed anywhere in memory, because its addresses are expressed relative to a starting point rather than as absolute values. The loader or the hardware supplies the actual base. The alternative is absolute code, produced by binding addresses at compile time. It must be loaded at one fixed address, and moving it requires recompilation - workable only where a single program owns the machine. Relocation may happen at load time, when the loader adjusts every address once, after which the program cannot move; or at execution time, when a base register is added to each address by hardware, and the program can be moved simply by changing the register. Only execution-time binding permits swapping and compaction, since both require a running process to change location. It is what every general-purpose system uses, and paging is its general form, with a page table in place of a single register.

Please log in or register to report this question.

Loading…

Other Subjects

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