06memmgt - FTP Directory Listing

clippersdogheartedSoftware and s/w Development

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

81 views

6

Memory Management

and

Processor Management

Resident and Transient


Resident


A routine that stays in memory.


Transient


A routine that is loaded as needed.


Transient area


Memory for application programs and transient
routines.

Fig. 6.1: The
operating system
occupies low
memory. The
remaining
memory is the
transient area.

Fig. 6.2:
Multiple
programs are
loaded and
executed
concurrently.

Fig. 6.3: Fixed
-
partition memory
management
divides the
available space
into fixed
-
length
partitions.

Fig. 6.4: Under
dynamic memory
management, a
region of
memory just
sufficient to hold
the program is
allocated when
the program is
loaded.

Fig. 6.5: With
segmentation,
programs are
divided into
independently
addressed
segments and
stored in
noncontiguous
memory.

Fig. 6.6: Dynamically
translating a segment address
to an absolute address.

Fig. 6.7: Dynamically
translating a page address
to an absolute address.

Fig. 6.8: Segmentation
and

paging.

Fig. 6.9a: Overlay structures. The complete
program consists of four modules.

Fig. 6.9b: Normally, only modules 1 and 2 are
in memory.

Fig. 6.9c: When an error occurs, module 3
overlays module 2.

Fig. 6.9d: At end
-
of
-
job, only modules 1 and
4 are needed.

Fig. 6.10: Virtual memory.

Virtual Memory


Real memory


physical memory


External paging device


usually disk


Virtual memory (a model)


resident operating system


page pool


external paging device


Fig. 6.11: Pages are
swapped between the
external paging device and
the real
-
memory page pool.

Virtual Memory


Virtual address dynamically translated


Page fault


referenced page not in real memory


Thrashing


excessive paging

Fig. 6.12: The operating system’s dispatcher
decides which ready program executes first.

Fig. 6.13: The
dispatcher decides
which program to
start by following a
linked list of
control blocks.

Fig. 6.14a: The
program issues
an interrupt.

Fig. 6.14b:
The interrupt
handler sets
the program to
a wait state.

Fig. 6.14c:
The dispatcher
starts another
application
program.

Fig. 6.14d:
The channel
sends the
processor an
interrupt.

Fig. 6.14e:
The interrupt
handler resets
program A to
a ready state.

Fig. 6.14f:
The dispatcher
selects an
application
program and
starts it.

Time
-
Sharing


Roll
-
in/roll
-
out memory management


Dispatching


Time
-
slicing


Polling

Fig. 6.15: Polling.

Fig. 6.16:
Queuing and
scheduling.

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


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.