Memory Management - Elvis.rowan.edu

mangledcobwebSoftware and s/w Development

Dec 14, 2013 (3 years and 8 months ago)

85 views

Basic Memory Management


Monoprogramming


Protection


Swapping


Overlaying

OS space

User space

Multiprogramming with Fixed
Partitions


Placement


External Fragmentation


Protection


Relocation

Variable Partition Allocation


Protection


Relocation


Compaction


Placement Strategies


First fit


Next fit


Best fit


Worst fit


Quick fit


Free

Allocated



Free

Allocated



Allocated


Variable Partition Allocation


Memory Management with Bitmaps




Memory Management with Linked Lists


1 1 0 0 0 1 1 1 0 0 0 0 1 1 1 0

1 0 1 1 0 0 1 1 1 1 0 0 0 1 1 1

1 1 1 1 1 0 0 0 1 1 1 0 0 1 1 1

P/H

Starts

Length

Ptr

Virtual Memory


Memory Hierarchy


Address Space


Run
-
time Memory


Logical Blocks
-

Segments


Physical Blocks
-

Pages

Primary memory

Secondary memory

Virtual Memory


Paging


Fixed size blocks


2
-
dim address




Mapping and address translation


Virtual to Physical


(
v.page

no., byte no.) (
p.page

no., byte no.)

PM

S
M

Page no.

Byte no.

Virtual Memory


Page
Tables


Logically one per process


No. of rows equal no. of pages


No. of columns determined by no. of entries (data
fields per page)


L/NL, M/NM, Page no., SSA, etc.


Address translation


Active PT, MMU, PTAR

Virtual Memory


Address translation


Active PT, MMU,
PTAR

L/
NL

M/
NM

Page
no.

SSA

1

1

200

xxx

0

yyy

1

0

128

zzz

4000

PTAR

VA: (2, 596)

PA: (128, 596)

PT

4000 + 2

Virtual Memory


Protection


Demand
Paging


Page
Faults


Expensive overhead


Prepaging


TLB


Translation
Lookaside

Buffer


Cache of high
-
demand pages

Page Replacement
Algorithms


The Optimal Page Replacement Algorithm


Least Recently Used


Least Frequently Used


First In First Out


FIFO



Page Replacement
Algorithms


Second Chance


Check “referenced” bit


Clock


Circular list with “referenced” bit


Not Recently Used


Check “referenced” and “modified” bits


4 classes of pages


The Working Set


The
WSClock

Design
and Implementation
Issues


Page size


Separate Instruction and Data Spaces


Shared Pages


Local versus Global Allocation


Page Fault Handling


Locking Pages in Memory


Segmentation


Process divided into logical blocks


segments


2 dim addressing (s.no., byte no)


virtual address


Segment Map Table (SMT) is required


Variable partition allocation


Address Translation


VA: (s.no., byte) PA: (partition begin
addr
., byte)


SMTAR Active SMT

Segmentation with
Paging


Process divided into segments


Segments divided into pages


Memory allocated as pages


VA: (s.no., page no., byte) PA: (page frame no., byte)