0

Operating System - 2

Description: Memory management Virtual SpaceStorage
Number of Questions: 20
Created by:
Tags: Memory management Virtual Space Storage
Attempted 0/20 Correct 0 Score 0

Consider a buddy system memory allocation where the size of a free memory segment is 256 KB, and the memory of kernel is 33 KB. To fulfill the request of memory allocation, a memory block of size M from free memory pool is allocated. What is the size of M?

  1. 33 KB

  2. 64 KB

  3. Two blocks, one of size 32 KB and other of size 1KB

  4. Two blocks each of size 32 KB

  5. 256 KB will be allocated


Correct Option: B
Explanation:

In buddy system, the memory is allocated in units sized as a power of 2, i.e. 4 KB, 16KB and so on. If the request is not of the appropriate size, it is rounded up to the next higher power of 2. In the given case, 256 KB of memory splits into two blocks of 128 KB each. It is further divided into two 64 KB blocks. 64 KB is the next higher size of power of 2, which can satisfy 33 KB of memory. So, this 64 KB block is allocated to the kernel.

Find out the total size of internal fragmentation in case of first fit algorithm. undefined

  1. 609 KB

  2. 659 KB

  3. 719 KB

  4. 599 KB

  5. None of these


Correct Option: B
Explanation:

Yes, it is the total size of internal fragmentation.

Consider a FIFO page replacement algorithm containing three frames. Initially, there is no page loaded in any of the frames. If the system first accesses 60 distinct pages in some order and then accesses the same pages in reverse order, calculate the total number of page faults.

  1. 120

  2. 114

  3. 117

  4. 60

  5. None of these


Correct Option: C
Explanation:

60 pages were accessed in some order from 1 to 60, which encountered 60 page faults. But in the reverse direction there was no page fault because the page numbers 58, 59, 60 were still present in the frames. So, the total number of page faults in the reverse direction will be 60 - 3 = 57 Total page faults = 60 + 57 = 117

In demand paging, if average page fault service time is 7 millisecond, memory access time is 150 nanoseconds. A process 'P' executes successfully without replacing any frame. What is the effective access time?

  1. Insufficient data

  2. 3500075 milliseconds

  3. 150 nanoseconds

  4. 7 milliseconds

  5. 7000150 milliseconds


Correct Option: C
Explanation:

If there is no page fault, the effective access time is equal to the memory access time.

If a page fault occurs in step 5, which of the step(s) will execute again? undefined

  1. Step 1 to step 5

  2. Step 2 to step 5

  3. Step 3 to step 5

  4. Step 4 and step 5 only

  5. Step 5 only


Correct Option: A
Explanation:

When a page fault occurs, we have to restart the whole instruction from the instruction fetch step.

__________ helps us to distinguish the pages in the memory and the pages on the disk.

  1. Base register

  2. Limit register

  3. Dispatcher

  4. Valid-invalid bit

  5. TLB (Translation Look-Aside Buffer)


Correct Option: D
Explanation:

Valid-invalid distinguishes the pages in the memory and the pages on the disk. If the bit is set as valid, the page is in the memory is legal. If the bit is set as invalid, the page is in the disk or invalid or both. TLB is a high speed memory, which is used to speed up the paging process.

If a process is spending much more time in paging than executing, then this phenomenon is called __________.

  1. belady's anomaly

  2. page fault

  3. compaction

  4. thrashing

  5. none of the above


Correct Option: D
Explanation:

In thrashing, the process spends much more time in paging than executing.

Local replacement algorithm is used to avoid

  1. thrashing

  2. fragmentation

  3. belady's anomaly

  4. starving

  5. deadlock


Correct Option: A
Explanation:

If one process starts the process of thrashing, it cannot steal frames from another process, which reduces the effect of thrashing.

A process can be swapped out from the memory, if i. its time quanta has expired in Round-robin scheduling ii. higher priority process has arrived in priority scheduling iii. a new process of less execution time has arrived in FCFS scheduling

  1. Only i

  2. Only i and ii

  3. Only i and iii

  4. Only ii and iii

  5. All of these


Correct Option: B
Explanation:

These are correct statements.

Demand paging is commonly used in ___________.

  1. paged memory management system

  2. segmented memory management system

  3. virtual memory management

  4. compaction

  5. none of these


Correct Option: C
Explanation:

It is used in virtual memory management system, with demand paged virtual memory. Pages are only loaded when they are demanded during the program execution.

Where does the swap space reside in the system?

  1. RAM

  2. Hard disk

  3. Optical device

  4. Pen drive

  5. None of these


Correct Option: B
Explanation:

Hard disk is a high speed disk and is usually known as swap space device.

Consider the following reference strings with three frames: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. Find out the total number of page fault, if LRU (Least Recently Used) page replacement algorithm is implemented.

  1. 11

  2. 16

  3. 21

  4. 15

  5. None of these


Correct Option: D
Explanation:

Total number of page fault will be 15 if LRU page replacement algorithm is implemented.

Which of the following is the fastest memory?

  1. Hard disk

  2. Dynamic RAM

  3. Static RAM

  4. Cache memory

  5. CD and DVD


Correct Option: D
Explanation:

It is the fastest memory. 

Which of the following is/are the extension(s) of Batch file?

  1. bat

  2. btm

  3. Both 1 and 2

  4. bin

  5. zip


Correct Option: C
Explanation:

bat and btm are the extensions of batch file used in different fields.

Attribute of file consists of _________.

  1. name

  2. identifier

  3. protection

  4. size

  5. all of these


Correct Option: E
Explanation:

File attributes consists all of the above.

Which of the following allows a user to erase the content of a file but keep its attributes?

  1. Deletion

  2. Creating a file

  3. Truncating a file

  4. Both 1 and 2

  5. None of these


Correct Option: C
Explanation:

This function allows all attributes to remain unchanged except the length. The lenght of a file can be reset to zero and its space is released.

Which of the following is/are the properties of storage devices? (i) Its speed is slower than the primary memory. (ii) It is cheaper than the primary memory. (iii) It is non-volatile in nature.

  1. Only (i)

  2. Only (i) and (ii)

  3. Only (ii) and (iii)

  4. Only (i) and (iii)

  5. All of these


Correct Option: E
Explanation:

All statements are true about storage devices.

Consider the following data ||| |---|---| |
Job size in KB |
Execution Time in microseconds | |
6 |
3 | |
9 |
4 | |
3 |
1 | |
5 |
2 | |
11 |
9 | |
20 |
6 | |
2 |
1 |

If the best fit algorithm is used for allocating jobs to memory partitions of sizes 4KB, 8KB, 20KB and 3KB, when will the 20KB job complete?

  1. 6 microseconds

  2. 19 microseconds

  3. 25 microseconds

  4. 15 microseconds

  5. None of these


Correct Option: B
Explanation:

Since it is best fit algorithm, so the first 20KB portion will be occupied by 9KB job, which takes 4 microseconds  and 11Kb job takes 9 microsecond and finally 20Kb job requires 6 microsecond. Total time = 4 + 9 + 6 = 19 microseconds

Calculate the total size of external fragmentation in first fit algorithm.

 Consider a partitioned memory of sizes 200 KB, 400 KB, 60 KB, 500 KB and 350 KB and processes of 268 KB, 125 KB, 340 KB, 110 KB and 58 KB arrive in order.

  1. 609 KB

  2. 659 KB

  3. 0 KB

  4. 60 KB

  5. None of these


Correct Option: C
Explanation:

Total size of external fragmentation is 0 KB because all the memory blocks are allocated to all the processes.

Which of the following cases takes the highest access time?

  1. Built in register in processor

  2. Cache

  3. RAM

  4. Magnetic disks

  5. All of these


Correct Option: D
Explanation:

Magnetic disk is slower as compared to other memories and its access time is the highest.

- Hide questions