Memory Management - Operating Systems - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Operating Systems which includes File-System Structure, Defining, Logical File, Physical Device, Secondary, System Organized, File Control Block, Structure Consisting, Typical File Control Block etc.Key important points are: Memory Management, Storage-Device Hierarchy, Storage Size, Access Speed, Various Levels of Storage, Background, Many Cycles, Array of Addresses, Addressing, Requirements

Typology: Slides

2012/2013

Uploaded on 03/28/2013

ekana
ekana 🇮🇳

4

(44)

370 documents

1 / 33

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Operating Systems
Lecture 21:
Memory Management
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21

Partial preview of the text

Download Memory Management - Operating Systems - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Operating Systems

Lecture 21:

Memory Management

Storage-Device Hierarchy

Access speed Cost Storage size

Background

  • Program must be brought from disk to memory and placed within a process to run
  • Main memory and registers are the only storage that the CPU can access
  • Register access in 1 CPU clock (or less), main memory takes many cycles
  • Memory as an array of addresses

Addressing

Memory Management

Requirements (cont’)

  • Sharing
  • Logical organization
    • Memory is organized linearly (usually), programs are written in modules
    • Modules can be written and compiled independently, different degrees of protection given to modules (read- only, execute-only)
  • Physical organization
    • Cannot leave the programmer with the responsibility to manage memory

Partitioning

  • An early method of managing memory
    • Pre-virtual memory
    • Not used much now
  • But, it will clarify the later discussion of virtual

memory if we look first at partitioning

  • Virtual Memory has evolved from the partitioning methods

Fixed Partitioning

  • Equal-size partitions (see fig 7.3a)
    • Any process whose size is less than or equal to the partition size can be loaded into an available partition
  • The operating system can swap a

process out of a partition

  • If none are in a ready or running state

Question

  • What are the main problems with a fixed

partition?

Question

  • How can we “solve” these

problems?

  • Use unequal size partitions
    • Still fixed sizes
    • The Problem is lessen but not solved

Placement Algorithm

  • Equal-size
    • Placement is trivial (no options)
  • Unequal-size
    • Can assign each process to the smallest partition within which it will fit
    • Queue for each partition
    • Processes are assigned in such a way as to minimize wasted memory within a partition

Remaining Problems with Fixed

Partitions?

Problems with Fixed Partitions

  • The number of active processes is limited by

the system (to the pre-determined number of

partitions)

  • A large number of very small process will not

use space efficiently

  • Solutions?

Dynamic Partitioning Example

  • External Fragmentation
  • Memory external to all

processes is fragmented

  • Can resolve using

compaction

  • OS moves processes so that they are contiguous
  • Time consuming and wastes CPU time

OS (8M)

P (20M)

P (14M)

P (18M)

Empty (56M)

Empty (4M)

P4(8M) Empty (6M)

P (14M) Empty (6M)

Refer to Figure 7.4 Docsity.com

Allocation

Allocation algorithms: Best-fit algorithm Next fit First fit (Worst fit)