Presentation Title
Memory management
Serial No.                               Topics
    1        Introduction to Memory & Memory hierarchy
    2        Introduction to MMU & its working
    3        Techniques of Memory Management( Paging and segmentation)
    4        segmentation
    5        Mono programming without Swapping or Paging (M. Fayyaz)
    6        Multiprogramming with fixed partitions. (M.Bilal)
    7        Swapping
    8        Managing Free Memory (Hiba Abdul Rauf)
    9        Memory Management with Bitmaps
   10        Dynamic Partitioning Placement Algorithm (Imran Bin Ramzan)
Memory is the internal storage area of the computer. Memory identifies
the data storage. The physical memory usually referred to us main
memory or RAM.
Memory Management Unit of the operating system handles the
memory hierarchy.



1. Keep track of what parts of memory are in use.
2. Allocate memory to processes when needed.
3. Deallocate when processes are done.
4. Swapping, or paging, between main memory and disk, when disk is
too small to hold all current processes.
It’s a term used to describe how operating systems handles the available RAM, it is
managed by multiple levels.


                          Techniques of M.M
In segmentation the virtual address space is divided into a number of variable-size
pieces called segments. One can view the designs we have studied so far as having
just one segment, the entire address space of the process.

Memory Management Scheme that supports user view of memory.
A program is a collection of segments.
A segment is a logical unit such as
          main program, procedure, function
          local variables, global variables, common block
          stack, arrays
       Protect each entity independently
       Allow each segment to grow independently
       Share each segment independently
1
                 2


 1
             4


             2   4
3

                 3




User Space       Physical Memory
– Logical address consists of a two tuple
        <segment-number, offset>
– Segment Table
    • Maps two-dimensional user-defined addresses into one-dimensional
      physical addresses. Each table entry has
        – Base - contains the starting physical address where the segments
          reside in memory.
        – Limit - specifies the length of the segment.
    • Segment-table base register (STBR) points to the segment table’s
      location in memory.
    • Segment-table length register (STLR) indicates the number of
      segments used by a program; segment number is legal if s < STLR.
Segmentation Architecture (cont.)


– Relocation is dynamic - by segment table
– Sharing
   • Code sharing occurs at the segment level.
   • Shared segments must have same segment number.
– Allocation - dynamic storage allocation problem
   • use best fit/first fit, may cause external fragmentation.
– Protection
   • protection bits associated with segments
      – read/write/execute privileges
      – array in a separate segment - hardware can check for illegal
        array indexes.
Shared segments

                                                       Limit  Base
             editor                                      25286 43602
                                                   0      4425 68348
           segment 0                               1                           43062
                          data 1                            Segment Table              editor
                                                             process P1        68348
                                                                                       data 1
                      segment 1                                                72773
Logical Memory
 process P1


                            editor                           Limit  Base
                                                               25286 43602     900
                                          data 2        0                              data 2
                          segment 0
                                                        1
                                                                8850 90003     03
                                                                               985
                                                               Segment Table
                                                                               53
        Logical Memory                                          process P2
         process P2                  segment 1
Segmented Paged Memory


– Segment-table entry contains not the base address of
  the segment, but the base address of a page table for
  this segment.
   • Overcomes external fragmentation problem of segmented
     memory.
   • Paging also makes allocation simpler; time to search for a
     suitable segment (using best-fit etc.) reduced.
   • Introduces some internal fragmentation and table space
     overhead.
– Multics - single level page table
– IBM OS/2 - OS on top of Intel 386
   • uses a two level paging scheme
Entire process remains in memory from start to finish.
The sum of the memory requirements of all jobs in the system
cannot exceed the size of physical memory.




   These are three simple ways of organizing memory an
   operating system with one user process
Memory management
Memory management
•Allocating space for growing data segment
•Allocating space for growing stack & data segment
Memory management
Managing Free Memory
When memory is assigned dynamically, the operating system must manage
it. In general terms, there are two ways to keep track of memory usage:
bitmaps and free lists. In this section and the next one we will look at these
two methods.
Memory management
Operating system must decide which free block to allocate to a process


Best-fit algorithm
    Chooses the block that is closest in size to the request
    Worst performer overall
    Since smallest block is found for process, the smallest
  amount of fragmentation is left
    Memory compaction must be done more often
First-fit algorithm
     Scans memory form the beginning and chooses
   the first available block that is large enough
     Fastest
     May have many process loaded in the front end
   of memory that must be searched over when
   trying to find a free block
Next-fit-Algorithm
    Scans memory from the location of the last
  placement
    More often allocate a block of memory at the
  end of memory where the largest block is found
    The largest block of memory is broken up into
  smaller blocks
    Compaction is required to obtain a large block
  at the end of memory
Worst Fit Algorithm:
 Search entire list.
  Produces the largest left over hole.
 Allocate the largest hole.
Memory management
Memory management

More Related Content

PPTX
Os unit 3
PPTX
Segmentation in operating systems
PPT
Virtual memory
PDF
Operating System-3 "Memory Management" by Adi.pdf
PPTX
Multi threaded programming
PPTX
Operating System Unit 1
PPTX
Operating Systems: Virtual Memory
PPT
Virtual memory
Os unit 3
Segmentation in operating systems
Virtual memory
Operating System-3 "Memory Management" by Adi.pdf
Multi threaded programming
Operating System Unit 1
Operating Systems: Virtual Memory
Virtual memory

What's hot (20)

PPTX
PPTX
Auxiliary memory
PPTX
Computer system bus
PDF
Computer architecture
PPTX
8237 dma controller
PPTX
Unit 4-booth algorithm
PPT
Memory management
PPS
Virtual memory
PPTX
Computer architecture virtual memory
PPTX
X86 Architecture
PDF
Intel x86 Architecture
PPT
Memory management ppt coa
PPTX
Memory Organization
PPTX
Demand paging
PDF
Intro to Buses (Computer Architecture)
PPS
Cache memory
PPTX
Lecture 3 instruction set
PPTX
Computer organization and architecture
PPTX
Memory organization (Computer architecture)
PPT
pipeline and vector processing
Auxiliary memory
Computer system bus
Computer architecture
8237 dma controller
Unit 4-booth algorithm
Memory management
Virtual memory
Computer architecture virtual memory
X86 Architecture
Intel x86 Architecture
Memory management ppt coa
Memory Organization
Demand paging
Intro to Buses (Computer Architecture)
Cache memory
Lecture 3 instruction set
Computer organization and architecture
Memory organization (Computer architecture)
pipeline and vector processing
Ad

Viewers also liked (16)

PDF
Memory management
PDF
Array Processor
PDF
Organising - MANAGEMENT PROCESS
PPT
Process management in os
PPT
Virtual memory
PPTX
Operating System-Memory Management
PDF
Virtual memory
PDF
8 memory management strategies
PDF
Virtual Memory and Paging
PPTX
Process management
PPTX
Paging and Segmentation in Operating System
PPTX
Pipelining and vector processing
PPTX
Paging and segmentation
PPT
Os Swapping, Paging, Segmentation and Virtual Memory
Memory management
Array Processor
Organising - MANAGEMENT PROCESS
Process management in os
Virtual memory
Operating System-Memory Management
Virtual memory
8 memory management strategies
Virtual Memory and Paging
Process management
Paging and Segmentation in Operating System
Pipelining and vector processing
Paging and segmentation
Os Swapping, Paging, Segmentation and Virtual Memory
Ad

Similar to Memory management (20)

PPT
37 segmentation
PPTX
Combined paging and segmentation
PPT
Chapter 2 part 1
PPTX
Paging +Algorithem+Segmentation+memory management
PPT
unit-4 class (2).ppt,Memory managements part-1
PPTX
Memory management in operating system | Paging | Virtual memory
PPTX
Unit-4 swapping.pptx
PPT
Memory Management
PPTX
Os unit 2
PPT
main memory
PPT
Segmentation geekssay.com
PPT
Chapter 04
PPTX
Memory Managment(OS).pptx
PDF
Chap4
PPT
Main memory os - prashant odhavani- 160920107003
PPTX
Memory Management techniques -ch8_1.pptx
DOCX
PAGIN AND SEGMENTATION.docx
37 segmentation
Combined paging and segmentation
Chapter 2 part 1
Paging +Algorithem+Segmentation+memory management
unit-4 class (2).ppt,Memory managements part-1
Memory management in operating system | Paging | Virtual memory
Unit-4 swapping.pptx
Memory Management
Os unit 2
main memory
Segmentation geekssay.com
Chapter 04
Memory Managment(OS).pptx
Chap4
Main memory os - prashant odhavani- 160920107003
Memory Management techniques -ch8_1.pptx
PAGIN AND SEGMENTATION.docx

More from Muhammad Fayyaz (7)

PDF
need order on fiverr.pdf
PDF
10 productivity booster hotkeys of Elmentor Page Builder.pdf
PDF
WPForms Plugin Review 2023 - Everything you need to know!
PDF
how to keep wordpress website secured.pdf
PPTX
Networking essentials
PPTX
Brainstorming
PPTX
Pak America Rationships
need order on fiverr.pdf
10 productivity booster hotkeys of Elmentor Page Builder.pdf
WPForms Plugin Review 2023 - Everything you need to know!
how to keep wordpress website secured.pdf
Networking essentials
Brainstorming
Pak America Rationships

Recently uploaded (20)

PDF
Myanmar Dental Journal, The Journal of the Myanmar Dental Association (2015).pdf
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
Lecture on Viruses: Structure, Classification, Replication, Effects on Cells,...
PPTX
ACFE CERTIFICATION TRAINING ON LAW.pptx
PDF
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
PDF
Health aspects of bilberry: A review on its general benefits
PPT
REGULATION OF RESPIRATION lecture note 200L [Autosaved]-1-1.ppt
PDF
Compact First Student's Book Cambridge Official
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
Fun with Grammar (Communicative Activities for the Azar Grammar Series)
PDF
Farming Based Livelihood Systems English Notes
PPTX
Macbeth play - analysis .pptx english lit
PPTX
Reproductive system-Human anatomy and physiology
PDF
faiz-khans about Radiotherapy Physics-02.pdf
PDF
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
PPTX
BSCE 2 NIGHT (CHAPTER 2) just cases.pptx
PPTX
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
PDF
Hospital Case Study .architecture design
PDF
0520_Scheme_of_Work_(for_examination_from_2021).pdf
PPTX
Climate Change and Its Global Impact.pptx
Myanmar Dental Journal, The Journal of the Myanmar Dental Association (2015).pdf
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
Lecture on Viruses: Structure, Classification, Replication, Effects on Cells,...
ACFE CERTIFICATION TRAINING ON LAW.pptx
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
Health aspects of bilberry: A review on its general benefits
REGULATION OF RESPIRATION lecture note 200L [Autosaved]-1-1.ppt
Compact First Student's Book Cambridge Official
Journal of Dental Science - UDMY (2021).pdf
Fun with Grammar (Communicative Activities for the Azar Grammar Series)
Farming Based Livelihood Systems English Notes
Macbeth play - analysis .pptx english lit
Reproductive system-Human anatomy and physiology
faiz-khans about Radiotherapy Physics-02.pdf
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
BSCE 2 NIGHT (CHAPTER 2) just cases.pptx
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
Hospital Case Study .architecture design
0520_Scheme_of_Work_(for_examination_from_2021).pdf
Climate Change and Its Global Impact.pptx

Memory management

  • 3. Serial No. Topics 1 Introduction to Memory & Memory hierarchy 2 Introduction to MMU & its working 3 Techniques of Memory Management( Paging and segmentation) 4 segmentation 5 Mono programming without Swapping or Paging (M. Fayyaz) 6 Multiprogramming with fixed partitions. (M.Bilal) 7 Swapping 8 Managing Free Memory (Hiba Abdul Rauf) 9 Memory Management with Bitmaps 10 Dynamic Partitioning Placement Algorithm (Imran Bin Ramzan)
  • 4. Memory is the internal storage area of the computer. Memory identifies the data storage. The physical memory usually referred to us main memory or RAM.
  • 5. Memory Management Unit of the operating system handles the memory hierarchy. 1. Keep track of what parts of memory are in use. 2. Allocate memory to processes when needed. 3. Deallocate when processes are done. 4. Swapping, or paging, between main memory and disk, when disk is too small to hold all current processes.
  • 6. It’s a term used to describe how operating systems handles the available RAM, it is managed by multiple levels. Techniques of M.M
  • 7. In segmentation the virtual address space is divided into a number of variable-size pieces called segments. One can view the designs we have studied so far as having just one segment, the entire address space of the process. Memory Management Scheme that supports user view of memory. A program is a collection of segments. A segment is a logical unit such as main program, procedure, function local variables, global variables, common block stack, arrays Protect each entity independently Allow each segment to grow independently Share each segment independently
  • 8. 1 2 1 4 2 4 3 3 User Space Physical Memory
  • 9. – Logical address consists of a two tuple <segment-number, offset> – Segment Table • Maps two-dimensional user-defined addresses into one-dimensional physical addresses. Each table entry has – Base - contains the starting physical address where the segments reside in memory. – Limit - specifies the length of the segment. • Segment-table base register (STBR) points to the segment table’s location in memory. • Segment-table length register (STLR) indicates the number of segments used by a program; segment number is legal if s < STLR.
  • 10. Segmentation Architecture (cont.) – Relocation is dynamic - by segment table – Sharing • Code sharing occurs at the segment level. • Shared segments must have same segment number. – Allocation - dynamic storage allocation problem • use best fit/first fit, may cause external fragmentation. – Protection • protection bits associated with segments – read/write/execute privileges – array in a separate segment - hardware can check for illegal array indexes.
  • 11. Shared segments Limit Base editor 25286 43602 0 4425 68348 segment 0 1 43062 data 1 Segment Table editor process P1 68348 data 1 segment 1 72773 Logical Memory process P1 editor Limit Base 25286 43602 900 data 2 0 data 2 segment 0 1 8850 90003 03 985 Segment Table 53 Logical Memory process P2 process P2 segment 1
  • 12. Segmented Paged Memory – Segment-table entry contains not the base address of the segment, but the base address of a page table for this segment. • Overcomes external fragmentation problem of segmented memory. • Paging also makes allocation simpler; time to search for a suitable segment (using best-fit etc.) reduced. • Introduces some internal fragmentation and table space overhead. – Multics - single level page table – IBM OS/2 - OS on top of Intel 386 • uses a two level paging scheme
  • 13. Entire process remains in memory from start to finish. The sum of the memory requirements of all jobs in the system cannot exceed the size of physical memory. These are three simple ways of organizing memory an operating system with one user process
  • 16. •Allocating space for growing data segment •Allocating space for growing stack & data segment
  • 18. Managing Free Memory When memory is assigned dynamically, the operating system must manage it. In general terms, there are two ways to keep track of memory usage: bitmaps and free lists. In this section and the next one we will look at these two methods.
  • 20. Operating system must decide which free block to allocate to a process Best-fit algorithm Chooses the block that is closest in size to the request Worst performer overall Since smallest block is found for process, the smallest amount of fragmentation is left Memory compaction must be done more often
  • 21. First-fit algorithm Scans memory form the beginning and chooses the first available block that is large enough Fastest May have many process loaded in the front end of memory that must be searched over when trying to find a free block
  • 22. Next-fit-Algorithm Scans memory from the location of the last placement More often allocate a block of memory at the end of memory where the largest block is found The largest block of memory is broken up into smaller blocks Compaction is required to obtain a large block at the end of memory
  • 23. Worst Fit Algorithm: Search entire list. Produces the largest left over hole. Allocate the largest hole.