In this section of Operating System Main Memory – Memory Management.it contain Operating System Main Memory – Memory Allocation to a process using Heap MCQs (Multiple Choice Questions Answers).All the MCQs (Multiple Choice Question Answers) requires in detail reading of Operating System subject as the hardness level of MCQs have been kept to advance level.
This MCQs section is mainly focused on below lists of topics
1.Reuse of memory.
-Maintaining a free list.
-Performing fresh allocation by using a free lists.
- First-Fit Technique
- Best-Fit Technique
- Next-Fit Technique
1. A Heap permits allocation and deallocation of memory in a ________ Manner.
- Random and Sequential order
- Sequential order
- Random Order
- None of the above
An Allocation request by a process returns with a pointer to the allocated memory area in the heap,and the process accesses the allocated memory area through this pointer. a deallocation request must present a pointer to the memory are through this pointer.
2. __________allocators are used by run-time support of programming language to manage PCD data,and by the kernel to manage its own memory requirements.
- Stack
- heap
- stack and heap
- None of the above
Stack based allocators are not used for data that are allocated and released in an unordered manner.
3. The speed of memory and efficient used of memory are two fundamental concerns in the design of memory allocator._______allocation addresses both these concerns effectively.
- stack-based
- heap-based
- stack and heap based
- None of the above
Since memory allocation and deallocation is very fast-the allocators modifies only the SB,FB and TOS pointers
to manage the free and allocated memory.
4. In _____ allocator released memory is not reused automatically when fresh allocation are made.
- stack-based
- heap-based
- stack and heap based
- None of the above
In heap ,reuse of memory is not automatic;the heap allocator must try to reuse a free memory are while making fresh allocations.however ,the size of a memory request rarely matches the size of previously used memory area.
5. Some memory are is left over when a fresh allocation is made in ___ allocator.
- stack-based
- heap-based
- stack and heap based
- None of the above
In heap ,reuse of memory is not automatic;the heap allocator must try to reuse a free memory are while making fresh allocations.however ,the size of a memory request rarely matches the size of previously used memory area.
6. Which of the below kernel functions can be used for reuse of memory in heap management?
- Maintaining a free list.
- select a memory area for allocation.
- merge free memory area.
- All of the above
The kernel maintains a free list to keep information about free memory area in the system.A memory request is satisfied by using the free memory area that is considered the most suitable for the request,and the memory left over from this memory area is entered in the free list.The kernel tries to merge free areas of memory into larger free area so that larger memory request can be granted.
7. which of the following control information the kernel needs to maintains for each memory area in the free list;
- The size of the memory areas
- the pointers used for forming the lists.
- The size of the memory areas and the pointers used for forming the lists.
- Stack pointer
8. Which of the following free lists is used to facilitate faster insertion and deletion operations on memory area while managing the free lists.
- Singly linked free list.
- Doubly linked free list
- Stack
- singly linked free list and stack
Singly linked list requires lot of work when a memory area is to be inserted into the list or deleted from it.as deletion of a memory area requires a change in the pointers stored in the previous memory area in the list.same this is for insertion operation.in Doubly linked free list each entry contains two pointers-one points to the next memory area in the list.while other points to the previous memory area.if a memory area with a specific address is to be deleted from the list,the kernel can simply take the pointer to the previous and following memory area in the list,and manipulate pointer in these areas to perform the deletion.
9. Which of the following techniques can be used to perform memory allocation by using a free list;
- First Fit technique
- Best-Fit technique
- Next-Fit technique
- All of the above.
10. To service a request for n bytes of memory,the _____ technique uses the first free memory area it can find whose size is ≥ n bytes.
- First Fit technique
- Best-Fit technique
- Next-Fit technique
- Good-Fit technique.
11. The ____ technique uses the smallest free memory area with size ≥ n bytes.
- First Fit technique
- Best-Fit technique
- Next-Fit technique
- Good-Fit technique.
12. The _____ technique remembers which entry in the free list was used to make the last allocation.to make new allocation,it searches the free list starting from the next entry and perform allocation using first free memory area whose size ≥ n bytes that it can find.
- First Fit technique
- Best-Fit technique
- Next-Fit technique
- Good-Fit technique.
13. ________ technique may split memory area at the start of the free list repeatedly,so free memory area become smaller with time.
- First Fit
- Best-Fit
- Next-Fit
- worst-Fit
the allocator may not have any large free memory area left to satisfy large memory request.Also several free memory areas may become unusably small.
14. ________ technique avoids needless splitting of large memory area.
- First Fit
- Best-Fit
- Next-Fit
- worst-Fit
15. ________ technique incurs higher allocation overhead
- First Fit
- Best-Fit
- Next-Fit
- worst-Fit
because it either has to process the entire free list at every allocation or maintain the free list in ascending order by size of free memory areas.
16. ________ technique avoids splitting the same free area repeatedly also avoids allocation overhead.
- First Fit
- Best-Fit
- Next-Fit
- worst-Fit