Docsity

Memory Management Functions - Information Technology - Lecture Slides, Slides of Information Technology

Partial preview of the text

Download Memory Management Functions - Information Technology - Lecture Slides and more Slides Information Technology in PDF only on Docsity!

โ€œMemory Management

Function

Contents ๏ƒ˜ Basic memory management ๏ƒ˜ Swapping ๏ƒ˜ Virtual memory ๏ƒ˜ Paging

Page replacement algorithmsModeling page replacement algorithmsDesign issues for paging systemsImplementation issues

๏ƒ˜^ Segmentation

Memory Management ๏‚ž^ Ideally programmers want memory that is^ ๏‚—^ large^ ๏‚—^ fast^ ๏‚—^ non volatile ๏‚ž^ Memory hierarchy^ ๏‚—^ small amount of fast, expensive memory โ€“ cache^ ๏‚—^ some medium-speed, medium price main memory^ ๏‚—^ gigabytes of slow, cheap disk storage ๏‚ž^ Memory manager handles the memory hierarchy

Multiprogramming with Fixed

Partitions ๏‚ž^ Fixed memory partitions^ ๏‚—^ separate input queues for each partition^ ๏‚—^ single input queue

Names and Binding

๏‚—^ Symbolic names

๏‚ฎ^ Logical names

๏‚ฎ^ Physical names

โ—‹^ Symbolic Names: known in a context or path^ ๏‚—^ file names, program names, printer/device names, user names โ—‹^ Logical Names: used to label a specific entity^ ๏‚—^ job number, major/minor device numbers, process id (pid), uid. โ—‹^ Physical Names: address of entity^ ๏‚—^ inode address on disk or memory^ ๏‚—^ entry point or variable address^ ๏‚—^ PCB address

Address Binding

๏‚ž^ Address binding^ ๏‚—^ fixing a physical address to the logical address of a processโ€™address space ๏‚ž^ Compile time binding^ ๏‚—^ if program location is fixed and known ahead of time ๏‚ž^ Load time binding^ ๏‚—^ if program location in memory is unknown until run-timeAND location is fixed ๏‚ž^ Execution time binding^ ๏‚—^ if processes can be moved in memory during execution^ ๏‚—^ Requires hardware support

Dynamic relocation with a base

register

๏‚ž^ Memory Management Unit (MMU) - dynamicallyconverts logical addresses into physical address ๏‚ž^ MMU contains base address register for running process

process

i Operatingsystem

Max addr^0

Max Mem

0 Physical memoryaddress

Relocation register for process

i^1000 +^ MMU Program generated address

Protection using base & limit

registers

๏‚ž^ Memory protection^ ๏‚—^ Base register gives starting address for process^ ๏‚—^ Limit register limits the offset accessible from therelocation register

base +

Physicaladdress^

memory register limitregister yes< no addressing^ error logicaladdress

Features of Memory Management^ ๏‚ž^ Relocation

  1. Static2. Dynamic ๏‚ž^ Protection ๏‚ž^ Sharing ๏‚ž^ Logical organization ๏‚ž^ Physical organization ๏‚ž^ Memory Compaction

Various Methods used by OS ๏‚ž Swapping ๏‚ž Virtual Memory ๏‚ž Paging ๏‚ž Segmentation

Swapping

๏‚ž^ Allocating space for growing data segment ๏‚ž^ Allocating space for growing stack & data segment

Memory Management with Bit Maps^ ๏‚ž

Part of memory with 5 processes, 3 holes^ ๏‚—^ tick marks show allocation units^ ๏‚—^ shaded regions are free ๏‚ž Corresponding bit map ๏‚ž Same information as a list

Managing memory with linked listsSearching the list for space for a new process^ ๏‚—^ First Fit^ ๏‚—^ Next Fit

โ—‹^ Start from current location in the list ๏‚— Best Fit โ—‹^ Find the smallest hole that will work โ—‹^ Tends to create lots of really small holes ๏‚— Worst Fit โ—‹^ Find the largest hole โ—‹^ Remainder will be big ๏‚— Quick Fit โ—‹^ Keep separate lists for common sizes

Virtual Memory

๏‚ž^ Virtual Memory^ โ—‹

Separation

of^ user

logical

memory

from

physical

memory. โ—‹ Only^ PART

of the program needs to be in memory for execution. โ—‹ Logical address space can be much larger than physicaladdress space. โ—‹ Need to allow pages to be swapped in and out. ๏‚ž^ Virtual Memory can be implemented via^ ๏‚—^ Paging^ ๏‚—^ Segmentation