Study: Memory Management, Swapping, Virtual Memory, and Page Replacement, Slides of Computer Science

An extensive exploration of various aspects of memory management, including basic memory management, swapping, virtual memory, and page replacement algorithms. It covers concepts such as monoprogramming, multiprogramming, modeling multiprogramming, relocation and protection, swapping, memory management with bit maps and linked lists, paging, page replacement algorithms, and optimal page replacement algorithms.

Typology: Slides

2012/2013

Uploaded on 03/21/2013

dheeraj
dheeraj 🇮🇳

5

(4)

101 documents

1 / 35

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Memory Management
Chapter 4
4.1 Basic memory management
4.2 Swapping
4.3 Virtual memory
4.4 Page replacement algorithms
4.5 Modeling page replacement algorithms
4.6 Design issues for paging systems
4.7 Implementation issues
4.8 Segmentation
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23

Partial preview of the text

Download Study: Memory Management, Swapping, Virtual Memory, and Page Replacement and more Slides Computer Science in PDF only on Docsity!

Memory Management

Chapter 4

4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms 4.6 Design issues for paging systems 4.7 Implementation issues 4.8 Segmentation

Memory Management

  • Ideally programmers want memory that is
    • large
    • fast
    • non volatile
  • Memory hierarchy
    • small amount of fast, expensive memory – cache
    • some medium-speed, medium price main memory
    • gigabytes of slow, cheap disk storage
  • Memory manager handles the memory hierarchy

Multiprogramming with Fixed Partitions

  • Fixed memory partitions
    • separate input queues for each partition
    • single input queue

Modeling Multiprogramming

CPU utilization as a function of number of processes in memory

Degree of multiprogramming

Relocation and Protection

  • Cannot be sure where program will be loaded in memory
    • address locations of variables, code routines cannot be absolute
    • must keep a program out of other processes’ partitions
  • Use base and limit values
    • address locations added to base value to map to physical addr
    • address locations larger than limit value is an error

Swapping (1)

Memory allocation changes as

  • processes come into memory
  • leave memory Shaded regions are unused memory

Memory Management with Bit Maps

  • Part of memory with 5 processes, 3 holes
    • tick marks show allocation units
    • shaded regions are free
  • Corresponding bit map
  • Same information as a list

Memory Management with Linked Lists

Four neighbor combinations for the terminating process X

Paging (2)

The relation between virtual addresses and physical memory addres- ses given by page table

Page Replacement Algorithms

  • Page fault forces choice
    • which page must be removed
    • make room for incoming page
  • Modified page must first be saved
    • unmodified just overwritten
  • Better not to choose an often used page
    • will probably need to be brought back in soon

Not Recently Used Page Replacement Algorithm

  • Each page has Reference bit, Modified bit
    • bits are set when page is referenced, modified
  • Pages are classified
    1. not referenced, not modified
    2. not referenced, modified
    3. referenced, not modified
    4. referenced, modified
  • NRU removes page at random
    • from lowest numbered non empty class

FIFO Page Replacement Algorithm

  • Maintain a linked list of all pages
    • in order they came into memory
  • Page at beginning of list replaced
  • Disadvantage
    • page in memory the longest may be often used

The Working Set Page Replacement Algorithm (1)

  • • The working set is the set of pages used by thew(k,t) is the size of the working set at time, t k most recent memory references

Modeling Page Replacement Algorithms

Belady's Anomaly

  • FIFO with 3 page frames
  • FIFO with 4 page frames
  • P 's show which page references show page faults Docsity.com