1 / 12

Memory management

Memory management. (Overlays, swa pping & compaction). By: Francis M. Tan. WHAT IS Overlays??. - means "replacement of a block of stored instructions or data with another .“ - a method that allows programs to be larger than the computer's main memory.

kiora
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 (Overlays, swapping & compaction) By: Francis M. Tan

  2. WHAT IS Overlays?? - means "replacement of a block of stored instructions or data with another.“ - a method that allows programs to be larger than the computer's main memory

  3. Some example… (non-splitted block of codes) INCLUDE SYSLIB (MOD1) INCLUDE SYSLIB (MOD2) OVERLAY A INCLUDE SYSLIB(MOD3) INCLUDE SYSLIB(MOD4) INCLUDE SYSLIB(MOD5) INCLUDE SYSLIB(MOD6) INCLUDE SYSLIB(MOD7) Root Segment MOD1, MOD2 OVERLAY A INCLUDE SYSLIB(MOD3) INCLUDE SYSLIB(MOD4) INCLUDE SYSLIB(MOD5) INCLUDE SYSLIB(MOD6) INCLUDE SYSLIB(MOD7)

  4. Some example… (splitted program codes) • INCLUDE SYSLIB (MOD1) • INCLUDE SYSLIB (MOD2) • OVERLAY A • INCLUDE SYSLIB(MOD3) • OVERLAY AA • INCLUDE SYSLIB(MOD4) • INCLUDE SYSLIB(MOD5) • OVERLAY AB • INCLUDE SYSLIB(MOD6) • OVERLAY B • INCLUDE SYSLIB(MOD7) Root Segment MOD1, MOD2 Overlay B MOD7 Overlay A MOD3 Overlay AA MOD3 Overlay AB MOD7

  5. WHAT IS memory “swapping”?? • a simple memory management policy • moving of a complete / entire process IN or OUT of memory processes between main memory and secondary. • Data can be moved includes: • process blocks (pcb) • data variables (i.e. heap, stack) • codes / program instructions (in machine language) • etc…

  6. Some example… Main Memory Secondary Memory Process 6 OS Swap OUT Process 3 Process 1 (40 KB) Swap IN Process 7 (15 KB) Process 5 Process 8 (20 KB) Process 2 Swap Space Files

  7. WHAT IS memory “compaction”?? • Memory compaction is the process of moving allocated objects together, and leaving empty space together • also known as “burping the memory” so that huge processes can fit into memory • merging vacant holes into one

  8. Some illustration… Compaction 1 Compaction 2 P1 = 200kb P1 = 200kb P1 = 200kb P2 = 100kb P2 = 100kb P2 = 100kb P3 = 400kb Free = 400kb Free = 900kb New Process MR = 700kb P4 = 200kb P4 = 200kb P4 = 200kb Free = 900kb Free = 300kb P5 = 300kb P6 = 400kb P6 = 400kb P6 = 400kb Free = 200kb P7 = 200kb

  9. Multiprogramming w/ fixed partition (MFP)… • accommodates jobs into memory only when the process fit in any of the fixed sized partitions. Internal Fragmentations – is the amount of unused memory space within a partition produced when a small process is allocated to a big partition. External Fragmentations – the amount of memory regions that are available but are too small to accommodate any incoming process.

  10. Algorithms used for mfp… • First Fit – allocation always starts at the beginning of the memory. • Best Fit – allocates an incoming job to the smallest available partition • Next Fit – modified version of FF. Starts from the beginning of the memory and allocates the job to the first hole that it finds capable of accepting the job. • Worst Fit – works in opposite manner when compared to BF. It allocates the largest hole to a particular program / process.

  11. Multiprogramming w/ variable partition (MvP)… • in this approach, user space is deemed as one big hole in the memory before the start of process allocation. • temporary partitions are created when jobs are placed inside the memory and this partitions are erased when jobs leaves the user space

  12. - THANK YOU! -

More Related