Operating System: Question Set – 22

Operating System: Question Set – 22

What are the advantages of virtual memory?

  • Allows execution of larger programs.
  • Isolates processes for security.
  • Efficient use of memory through paging and swapping.

What are the disadvantages of virtual memory?

  • Increased complexity in management.
  • Performance overhead due to page faults.
  • Dependency on disk performance.

What is memory protection?

Memory protection ensures one process cannot access another’s memory, preventing data corruption and enhancing security. Techniques include:

  • Base and limit registers.
  • Segmentation and paging.

What is the difference between paging and segmentation?

FeaturePagingSegmentation
Memory divisionFixed-size pages and framesVariable-sized segments
Variable-sized segmentsSingle-level (page number, offset)Two-level (segment number, offset)
FragmentationInternal fragmentationExternal fragmentation

What is frame allocation?

Frame allocation determines how many frames are allocated to each process. Strategies include:

  1. Equal Allocation: Equal frames to all processes.
  2. Proportional Allocation: Frames based on process size.
  3. Priority Allocation: Frames based on process priority.

What is a memory-mapped file?

When a file is directly mapped into memory, it can be accessed by processes as though it were a part of their address space. This is known as a memory-mapped file.

What is buddy system allocation?

Memory is partitioned into 2^k blocks by the buddy system. Memory is allotted to the closest power of two upon request. It is merged back with its friend if it is not used.

How does garbage collection relate to memory management?

In high-level programming languages like Python and Java, garbage collection automatically finds and recovers unused memory to stop memory leaks.

What is NUMA (Non-Uniform Memory Access)?

The position of memory in relation to the CPU determines the memory access time in the NUMA memory architecture. It enhances multi-core computers’ performance.

What is the purpose of cache memory in memory management?

By keeping frequently accessed data closer to the CPU, cache memory shortens access times and boosts system efficiency.

What is copy-on-write (COW)?

Copy-on-write allows processes to share the same memory pages until one process modifies the page. At that point, a copy is made for the modifying process.

What is slab allocation?

In order to minimize allocation and deallocation cost, kernel memory management uses slab allocation, which pre-allocates memory blocks of preset sizes (slabs).

Leave a Reply

Your email address will not be published. Required fields are marked *