Outline for 2/2/98

  • Last time: Started talking about memory management - to fragmentation problem.

  • Administrative: Pictures are finally here (on our pages soon)

  • Objective: Continue on memory management schemes

    Overlays

  • Explicit (user controlled) movement between levels of the memory hierarchy.

  • Explicit calls to load regions of the address space into physical memory.

  • Based on identifying 2 areas in the address space that are not needed at the same time.

    Virtual Memory

  • System-controlled movement up and down in the memory hierarchy.

  • Can be viewed as automating overlays - the system attempts to dynamically determine which previously loaded parts can be replaced by parts needed now.

  • It works only because of locality of reference.

  • Often most closely associated with paging (needs non-contiguous allocation, mapping table).

    Locality

  • Only a subset of the program's code and data are needed at any point in time. Can the OS predict what that subset will be (from observing only the past behavior of the program)?

  • Temporal - Reuse. Tendency to reuse stuff accessed in recent history (code loops).

  • Spatial - Tendency to use stuff near other recently accessed stuff (straightline code, data arrays). Justification for moving in larger chunks.

    Sharing

  • The indirection of the mapping mechanism in paging makes it tempting to consider sharing code or data - having page tables of two processes map to the same page, but…

  • What if there are addresses embedded inside the page to be shared?

    Segmentation

  • A better basis for sharing. Naming is by logical unit (rather than arbitrary fixed size unit) and then offset within unit (e.g. procedure).

  • Segments are variable size

  • Segment table is like a bunch of base/limit registers.

    Combining Segmentation and Paging

  • Sharing supported by segmentation. Programs name shared segments.

  • Physical storage management simplified by paging of each segment.