slide1 l.
Download
Skip this Video
Download Presentation
Memory Management and Processor Management

Loading in 2 Seconds...

play fullscreen
1 / 60

Memory Management and Processor Management - PowerPoint PPT Presentation


  • 148 Views
  • Uploaded on

6. Memory Management and Processor Management. Management of Resources. Measure of Effectiveness On most modern computers, the operating system serves as the primary resource manager allocating and managing: Processor Time Memory Space Peripheral Devices Secondary Storage Space Data

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Memory Management and Processor Management' - vala


Download Now 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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2

6

Memory Management

and

Processor Management

management of resources
Management ofResources
  • Measure of Effectiveness
    • On most modern computers, the operating system serves as the primary resource manager allocating and managing:
      • Processor Time
      • Memory Space
      • Peripheral Devices
      • Secondary Storage Space
      • Data
      • Program Libraries
management of resources4
Management ofResources
  • Measure of Effectiveness
    • A well-designed operating system attempts to optimize the utilization pf all the system resources.
    • Resource management is a key operating system function.
    • The operating system’s job is to manage the computer system’s resources as efficiently as possible.
processor management
Processor Management
  • Processor Management
    • Concerned with managing the processor’s time.
memory management
Memory Management
  • Memory Management
    • Concerned with managing the computer’s available pool of memory:
      • Allocating space to application routines and making sure that they do not interfere with each other.
operating system management routines
Operating System Management Routines
  • Resident
    • A routine that stays in memory because it directly supports application programs as they run.
  • Transient
    • A routine that is loaded as needed.
  • Transient area
    • Memory for application programs and transient routines.
slide8
Fig. 6.2: The operating system (Resident & Transient Routines) occupies low memory. The remaining memory is the transient area.
overlay structures
Overlay Structures
  • Developed when the amount of available memory was limited.
  • Divide the program into logically independent modules.
    • Module 1 holds the main control logic and key data common to the entire program.
    • Module 2 processes valid input data.
    • Module 3 processes errors.
    • Module 4 generates end-of-program statistics.
memory management concurrency
Memory Management Concurrency
  • A program cannot process data it does not have.
  • A program spends more time waiting for I/O than processing data.
memory management concurrency16
Memory Management Concurrency
  • Resolution –
    • Put a additional programs into memory.
    • Where ?
    • How ?
memory management partitions and regions18
Memory ManagementPartitions and Regions
  • Fixed-Partition Memory Management
  • Regions – Dynamic Memory Management.
memory management partitions
Memory ManagementPartitions
  • Fixed-Partition Memory Management
    • Divides the available space into fixed-length partitions
    • Each partition can execute a program
    • Partition size is set when the operating system is generated.
fig 6 4 fixed partition memory management divides the available space into fixed length partitions
Fig. 6.4: Fixed-partition memory management divides the available space into fixed-length partitions.
memory management partitions21
Memory ManagementPartitions
  • Fragmentation occurs because
    • With Fixed-Partition Memory Management
      • It is assumed that a given program must be loaded into contiguous memory.
      • Not all the space assigned to a partition may be used
memory management regions
Memory ManagementRegions
  • Regions - Dynamic Memory Management
    • The transient area is treated as a pool of free space
    • When a program needs to be executed
      • A region of memory just sufficient to hold the program is allocated from the transient pool
      • The program is loaded into this region
slide23
Fig. 6.5:Under dynamic memory management, a region of memory just sufficient to hold the program is allocated when the program is loaded.
memory management regions24
Memory ManagementRegions
  • Fragmentation occurs because
    • With Dynamic Memory Management
      • It is assumed that a given program must be loaded into contiguous memory.
      • With dynamic allocation, bits of unused space is spread throughout memory.
memory management regions25
Memory ManagementRegions
  • Regions - Dynamic Memory Management
    • Utilizes:
      • Segmentation
      • Paging
memory management regions26
Memory ManagementRegions
  • Segmentation:
    • Programs are divided into independently addressed segments and stored in non-contiguous memory.
memory management segmentation
Memory ManagementSegmentation
  • When a program is loaded into memory:
    • the operating system builds a segment table for the program listing the absolute entry point address of each of the program’s segments.
    • As the program executes, addresses must be translated from relative to absolute form.
  • Base + Displacement
  • Segment + Displacement
slide28
Fig. 6.6: With segmentation, programs are divided into independently addressed segments and stored in noncontiguous memory.
memory management paging
Memory ManagementPaging
  • A program is broken into fixed-length pages (2k – 4K)
  • The pages are loaded into noncontiguous memory.
  • As the pages are loaded into memory, a page table is created.
  • Page Addresses:
    • Page Number
    • Page Displacement
memory management segmentation and paging
Memory ManagementSegmentation and Paging
  • Addresses are divided into:
    • A segment number
    • A page number within that segment
    • A displacement within that page
  • After the ICU expands the relative address:
    • The program’s segment table is searched for the segment number which yields the address of the segment’s page table
    • The page table is searched for the page’s base address which is added to the displacement to get an absolute address.
memory management virtual memory
Memory ManagementVirtual Memory
  • Three Levels of Storage
    • Real Memory
      • Main memory, directly addressable by the processor
  • External Paging Device
    • Disk
    • Virtual Memory
      • Acts just like real memory, but isn’t real memory.
memory management virtual memory37
Memory ManagementVirtual Memory
  • Divides main storage into 2K sections called pageframes.
  • Divides all programs into 2K sections called pages.
  • When the operating system loads a program for execution, it first divides the program into pages and stores the pages on a disk file called the PAGE DATA SET.
  • The operating system then loads the pages of the program that are initially active into main (real) storage.
  • When a part of the program which is not in real storage is needed, a PAGE FAULT occurs. The operating system loads the page containing that code into real storage.
memory management virtual memory38
Memory ManagementVirtual Memory
  • When real storage is completely filled with active pages and another page is needed in real storage:
      • The operating system selects a page that has been in real storage the longest without being referenced;
      • Writes it back on the Page Data Set (page-out) if the contents of the page have been changed since it was first brought into realstorage;
      • Brings in the new page into real storage (page-in).
memory management virtual memory39
Memory ManagementVirtual Memory
  • Virtual address dynamically translated
  • Thrashing
    • excessive paging
    • Seriously degrades system performance
multiprogramming
Multiprogramming
  • Interrupt
    • An electronic signal
    • A program surrenders control of the processor when it requests an I/O operation and is eligible to continue when the I/O operation is completed.
multiprogramming41
Multiprogramming
  • Interrupts can originate with:
    • Software
      • A program issues an interrupt to request the operating system’s support Hardware for an I/O operation
    • Hardware
      • Hardware issues an interrupt to notify the processor that an asynchronous event has occurred.
    • Illegal operations
multiprogramming42
Multiprogramming
  • Control Block
    • Created to hold a partition’s key control flags, constants, and variables.
    • Linked to form a linked list
    • The Dispatcher determines which program is to start by following the chain of pointers from control block to control block.
scheduling and queuing
Scheduling and Queuing
  • As programs enter the system, they are placed on a queue by the queuing routine.
  • When space becomes available, the scheduler selects a program from the queue and loads it into memory.
fig 6 13 the dispatcher decides which program to start by following a linked list of control blocks
Fig. 6.13: The dispatcher decides which program to start by following a linked list of control blocks.
slide49
Fig. 6.14c: After the Interrupt Handler Routine starts the requested I/O operation, the dispatcher starts another application program.
fig 6 14e following the interrupt the interrupt handler routine resets program a to a ready state
Fig. 6.14e: Following the interrupt, the interrupt handler routine resets program A to a ready state.
slide52
Fig. 6.14f: After the interrupt is processed, the dispatcher selects an application program and starts it.
fig 6 11 pages are swapped between the external paging device and the real memory page pool
Fig. 6.11: Pages are swapped between the external paging device and the real-memory page pool.
time sharing
Time-Sharing
  • Managing multiple concurrent users designed with interactive processing in mind.
  • Roll-in/roll-out memory management
  • Dispatching
    • Time-slicing
    • Polling
time sharing55
Time-Sharing
  • Roll-in/roll-out memory management
    • Executing a series of brief transactions
    • As a given transaction is processed, the system knows that considerable time will pass before that next user’s transaction arrives.
    • The workspace is rolled out to secondary storage, making room for another application in memory.
    • When the first user’s next transaction arrives, his/her workspace is rolled back in.
time sharing56
Time-Sharing
  • Time-Slicing
    • Each program is restricted to a maximum slice of time
    • Once a program begins executing, it runs until
      • The program requires input or output before exhausting its time slice.
        • Sends an I/O interrupt to the operating system
        • Drops into a wait state.
time sharing57
Time-Sharing
  • Time-Slicing
    • Once a program begins executing, it runs until
      • The program requires input or output before exhausting its time slice.
      • The program uses up its entire time slice
        • Sends an I/O interrupt to the operating system
        • Drops into a wait state.
        • The dispatcher starts the next program.
spooling
Spooling
  • Copying data from a slow input device to disk for subsequent processing.
  • Copying data to disk for subsequent output to a slow device such as a printer.
deadlock
Deadlock
  • Two (or more) programs each control a resource needed by the other.
  • Neither program can continue without the needed resource.
  • Neither program will surrender its control.
ad