Memory Management

stizzahaddockΛογισμικό & κατασκευή λογ/κού

14 Δεκ 2013 (πριν από 4 χρόνια και 3 μήνες)

90 εμφανίσεις

Memory Management

1. Single contiguous allocation

2. Partitioned organization:

Static, Dynamic

3. (Pure) Paging

Memory Management

1. Single Contiguous Allocation

Early, uni
programmed machines

Memory divided into 3 areas:

Memory management developed over time

(Historical Overview)

OS (32K)

User Job (64K)

Wasted (160K)

Memory (256K)

Single Contiguous Allocation

Hardware : Bounds register, supervisor

Software : User job

available memory?

If so, allocate and run to completion

If not, error

Advantage : simplicity

Disadvantages : poor M, P utilitization

job must fit into M

Memory Management

2. Partitioned Organization

Early multiprogramming environment

Memory divided into partitions. Each holds
1 job.


Partitioned Organization

Software :

1. Keep track of status of partitions

Size, Free or Allocated

2. Which job gets M [Job Scheduler]

3. Alloc :

Free partition of sufficient size assigned

4. Dealloc :

Freed when job terminates

Hardware :

2 bounds registers to bracket partition

Locks and keys [IBM]

Each partition has own protection key

When processor assigned, “key” in PSW =

Key of partition

Partitioned Organization

Two types of partitions :

Static Partitions

Memory divided into partitions according
to OS or Operator specification

Each job specifies max memory req’d;
memory management assigns partition
of sufficient size

Appropriate if : size, frequency of jobs

OW : wasteful of M

Estimated 75% wasted

Partitioned Organization

Two types :

Dynamic Partitions

Created during job processing to
match partition to job size

Need tables for allocating,
deallocating partitions : Size,
Location, Status.


Partitioned Organization

Dynamic Partitions

Jobs terminate, new partitions created from
freed areas, subject to :

1. Free area

Job size

2. If >, fragmentation

3. On deallocation, merge adjacent free areas

Implementation :

Table size varies

Append info to each partition and chain

Lists of free, alloc partitions

3. (Simple or Pure) Paging

Each job’s address space

Equal pieces



pieces of same size

Frames (blocks)

User :

Sees logically continuous address space

But pages loaded into frames which are not contiguous

HW maps any page into any frame

Mapping : PMT (Separate registers, 1/Page)

Page size is critical (1
4K, in powers of 2)

Solves fragmentation problem without moving

Memory Management



Hardware :

1 register/page needed for memory

High speed registers or memory locations

Dynamic Address Translation (DAT)

Divides EA into :

0 …. 7 8 …. 19 20 …. 31

Page number

Byte offset


Consider IBM example :

Page Size = 2
or 4096 bytes

Effective address (EA) = 24 bits

DAT : Divides EA into page index, byte

PMT : Maps page number to frame number

Physical address of page

Add byte offset

Address of operand

Software : Need 3 tables

1 PMT/job, with 1 entry per page

A memory block (frame) table (MBT), with status
info for each frame (if used, by whom)

A job table (JT), with 1 entry/job (Size, status,
pointer to PMT)


Advantages :

Facilitates multiprogramming by
eliminating fragmentation (more jobs in
memory, no compacting)

Facilitates sharing of info (memory)
among jobs by incorporating pages in
more than 1 job’s address space


Disadvantages :

Page address mapping

HW costly, time

Tables : Memory required for PMTs, time to update

Internal fragmentation (page breakage)

Half page/job wasted on average

Tradeoff :

Small pages (min page wastage) vs

Large pages (reducing # entries in PMT)

Know average job size

Some memory may not be used (if #frames <
address space)

Memory still contains infrequently used info

Job size must be

Memory size