Docsity

Operating System - memory Management Part 4 - Notes, Study notes of Operating Systems

Partial preview of the text

Download Operating System - memory Management Part 4 - Notes and more Study notes Operating Systems in PDF only on Docsity!

MEMORY MANAGEMENT

Shared Pages

Example

User’s

View of a

Program

Logical View of Segmentation

1 4 2 3 user space physical memory space

Virtual Memory

  • (^) Background
  • (^) Demand Paging
  • (^) Process Creation
  • (^) Page Replacement
  • (^) Allocation of Frames
  • (^) Thrashing
  • (^) Demand Segmentation
  • (^) Operating System Examples

Definition: Virtual Memory

  • (^) Virtual Memory is a memory management technique that allows execution of a program that is not completely in memory.
  • (^) Virtual memory considers main memory as extremely large uniform array of storage.
  • (^) Virtual memory provides separation of user logical memory from physical memory.

Background

  • (^) As we know that instructions being executed must be in the main memory.
  • (^) This needs to place entire logical memory into the main memory.
  • (^) Under this consideration we can only execute a program of maximum size requirement is equal to main memory.

Background

  • (^) It is not important to load complete program to main memory because - (^) Error handling codes executes occasionally. - (^) Some of the functions are rarely used. - (^) Some Data Structures reserve more memory space than their actual requirement.
  • (^) This suggests that the ability to store program partially would have many benefits.

Advantages of Virtual Memory

  • (^) Availability of multiple program in main memory will increase degree of multi-programability , throughput and CPU utilization.
  • (^) If multiple programs are running together, less input output is required from users side.

Working of Virtual Memory

  • (^) A program can be handled by users perspective without knowing anything about physical memory.
  • (^) It is possible to provide extremely large virtual memory when a limited physical memory is present there.

Virtual-address Space

  • (^) The virtual address space of a process refers to the logical or virtual view of how a process is stored in the main memory.

Virtual-address Space

  • (^) Here we allow the heap to grow upwards in memory as it uses dynamic memory allocation.
  • (^) Stack is growing downwards through successive function calls.
  • (^) Besides this sparse address space is available to serve the growing requirements.

Shared Library

Using Virtual

Memory

Implementation of Virtual

Memory

  • (^) Virtual memory can be implemented via:
    • (^) Demand paging
    • (^) Demand segmentation