Memory Management - PowerPoint PPT Presentation

About This Presentation
Title:

Memory Management

Description:

The task of subdividing the user area is carried out dynamically by the OS -- memory management ... is divided in segments and loaded in dynamic partitions ... – PowerPoint PPT presentation

Number of Views:257
Avg rating:3.0/5.0
Slides: 12
Provided by: DrAlB
Learn more at: http://home.ubalt.edu
Category:

less

Transcript and Presenter's Notes

Title: Memory Management


1
Memory Management
2
  • Why memory management?
  • Processes need to be loaded in memory to execute
  • Multiprogramming
  • The task of subdividing the user area is carried
    out dynamically by the OS -- memory management

3
  • Storage organization

4
  • What is required of memory management?
  • Relocation
  • ability to load in relative addresses
  • ability to translate relative into absolute
    (real) addresses
  • Protection
  • processes should not be able to reference memory
    locations of other processes without permission
  • it has to be provided at run time
  • Sharing
  • several processes should be able to access the
    same portion of main memory
  • Logical organization
  • most programs are organized in modules
  • the OS should be able to handle modules or
    segments
  • Physical organization
  • primary and secondary
  • support overlaying

5
  • Memory Management Techniques

6
  • Virtual memory

DAT
Real
Virtual
7
  • Virtual memory requirements
  • All memory references within a process are
    logical, translated to physical at run time
  • A process may be broken up into a number of
    pieces (pages or segments)
  • There is no need for all the pages or all
    segments of a process to be in main memory at the
    time of execution
  • Only a resident set of the process needs to be in
    memory

8
  • Paging
  • Page table for each process
  • frame location of each page of the process
  • program logical address is a page number plus an
    offset (d) within the page
  • page table physical address is a frame number
    plus an offset (d) within the frame
  • the processor should use the page table to do the
    translation
  • page tables can be big, stored in virtual storage
  • Page table mechanisms
  • inverted page tables one entry for each real
    page rather than virtual page
  • translation lookaside buffer a page table cache
  • page fault, roll-in, roll-out, thrashing
  • direct and associative mapping

9
  • Segmentation
  • memory is seen as a set of segments, multiple
    address spaces
  • segments can be of variable size
  • segment table to each process
  • logical address segment number, offset (d)
  • physical address memory address, segment length
  • data structures (variable length) can be assigned
    to segments
  • programs can be developed and maintained by
    segments
  • increases code reuse and sharing
  • supports protection
  • combined paging and segmentation (s,p,d)

10
  • Policies for virtual memory
  • Fetch policy demand and prepaging
  • Placement policy relevant for segmentation
  • Replacement policy
  • optimal
  • first-in, first-out (FIFO)
  • least recently used (LRU)
  • clock policy and variations (1 used, 0 not)
  • selects 0, every time it tests turns 1s in 0s
  • second bit for page modification
  • page buffering
  • Locality temporal and spatial
  • Cleaning policy demand, precleaning and buffering

11
  • Page fault and page size

Page fault
Page size
  • Page size is a hardware design decision (remember
    DAT)
  • Small page size decrease internal fragmentation,
    but
  • Small page size increase the number of pages in
    table, and
  • Small page size increase page fault
  • Some computer page sizes 512 bytes - VAX, IBM
    AS/400 4 Kbytes - IBM370, PowerPC 4 Kbytes to 4
    Mbytes - Pentium
Write a Comment
User Comments (0)
About PowerShow.com