Memory Management PowerPoint PPT Presentation

presentation player overlay
1 / 8
About This Presentation
Transcript and Presenter's Notes

Title: Memory Management


1
Memory Management
  • Operating Systems - Spring 2003
  • Gregory (Grisha) Chokler
  • Ittai Abraham
  • Zinovi Rabinovich

2
Segmentation
  • A program can be divided into segments
  • Segments are of variable size
  • Segments reflect the logical (modular) structure
    of a program
  • Text segment, data segment, stack segment
  • Similar to dynamic partitioning except segments
    of the same process can be scattered
  • subject to external fragmentation

3
Address translation
  • Maximum segment size is always a power of 2
  • Process segment table maps segment numbers into
    their base addresses in the memory
  • With the maximum segment size of 2r, a logical
    address of lr bits is interpreted as a pair
    (l,r)
  • l segment number, r offset within the segment
  • l is used as an index into the segment table

4
Hardware support
Virtual Address
Segment Table

Base d
Seg
Offset d
Register
Seg Table Ptr
Segment Table
d
Segment
S

Length Base
Program
Segmentation
Main Memory
5
Segmentation Properties
  • Advantages
  • Association of protection with the segments
  • Sharing of code or data
  • Problems
  • Dynamic memory allocation with external
    fragmentation

6
Segmentation with paging
  • Segmentation
  • simplifies protection and sharing, enforce
    modularity, but prone to external fragmentation
  • Paging
  • transparent, eliminates ext. fragmentation,
    allows for sophisticated memory management
  • Segmentation and paging can be combined

7
Address translation
8
Remarks
  • The price of paging/segmentation is a
    sophisticated hardware
  • But the advantages exceed by far
  • Paging decouples address translation and memory
    allocation
  • Not all the logical addresses are necessary
    mapped into physical memory at every given moment
    - virtual memory
  • Paging and segmentation are often combined to
    benefit from both worlds
Write a Comment
User Comments (0)
About PowerShow.com