1 / 19

Memory Management

Memory Management. 1. Single contiguous allocation 2. Partitioned organization: Static, Dynamic 3. (Pure) Paging. Memory Management. Memory management developed over time (Historical Overview). 1. Single Contiguous Allocation Early, uni-programmed machines Memory divided into 3 areas:.

starr
Download Presentation

Memory Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Memory Management • 1. Single contiguous allocation • 2. Partitioned organization: • Static, Dynamic • 3. (Pure) Paging

  2. Memory Management Memory management developed over time (Historical Overview) • 1. Single Contiguous Allocation • Early, uni-programmed machines • Memory divided into 3 areas: OS (32K) User Job (64K) Memory (256K) Wasted (160K)

  3. Single Contiguous Allocation • Hardware : Bounds register, supervisor mode • Software : User job available memory? • If so, allocate and run to completion • If not, error • Advantage : simplicity • Disadvantages : poor M, P utilitization • job must fit into M

  4. Memory Management • 2. Partitioned Organization • Early multiprogramming environment • Memory divided into partitions. Each holds 1 job. • E.g.

  5. Partitioned Organization • Software : • 1. Keep track of status of partitions • Size, Free or Allocated • 2. Which job gets M [Job Scheduler] • 3. Alloc : Free partition of sufficient size assigned • 4. Dealloc : Freed when job terminates • Hardware : • 2 bounds registers to bracket partition • Locks and keys [IBM] • Each partition has own protection key • When processor assigned, “key” in PSW = Key of partition

  6. Partitioned Organization • Two types of partitions : • Static Partitions • Memory divided into partitions according to OS or Operator specification • Each job specifies max memory req’d; memory management assigns partition of sufficient size • Appropriate if : size, frequency of jobs known • OW : wasteful of M • Estimated 75% wasted

  7. Partitioned Organization • Two types : • Dynamic Partitions • Created during job processing to match partition to job size • Need tables for allocating, deallocating partitions : Size, Location, Status. • E.g.

  8. Partitioned Organization • Dynamic Partitions • Jobs terminate, new partitions created from freed areas, subject to : • 1. Free area  Job size • 2. If >, fragmentation • 3. On deallocation, merge adjacent free areas • Implementation : • Table size varies  • Append info to each partition and chain • Lists of free, alloc partitions

  9. Memory Management • 3. (Simple or Pure) Paging • Each job’s address space  Equal pieces  frames • Memory  pieces of same size  Frames (blocks) • User : • Sees logically continuous address space • But pages loaded into frames which are not contiguous • HW maps any page into any frame • Mapping : PMT (Separate registers, 1/Page) • Page size is critical (1-4K, in powers of 2) • Solves fragmentation problem without moving partitions

  10. (Pure paging)

  11. Paging • Hardware : • 1 register/page needed for memory mapping • High speed registers or memory locations (cache) • Dynamic Address Translation (DAT) • Divides EA into : 0 …. 7 8 …. 19 20 …. 31 Page number Byte offset

  12. Paging • Consider IBM example : • Page Size = 212 or 4096 bytes • Effective address (EA) = 24 bits • DAT : Divides EA into page index, byte displacement • PMT : Maps page number to frame number •  Physical address of page • Add byte offset Address of operand • Software : Need 3 tables • 1 PMT/job, with 1 entry per page • A memory block (frame) table (MBT), with status info for each frame (if used, by whom) • A job table (JT), with 1 entry/job (Size, status, pointer to PMT)

  13. Paging • Advantages : • Facilitates multiprogramming by eliminating fragmentation (more jobs in memory, no compacting) • Facilitates sharing of info (memory) among jobs by incorporating pages in more than 1 job’s address space

  14. Paging • Disadvantages : • Page address mapping - HW costly, time-consuming • Tables : Memory required for PMTs, time to update • Internal fragmentation (page breakage) • Half page/job wasted on average • Tradeoff : • Small pages (min page wastage) vs • Large pages (reducing # entries in PMT) • Know average job size • Some memory may not be used (if #frames < address space) • Memory still contains infrequently used info • Job size must be  Memory size

More Related