Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Management
1. Requirement for Memory Management
a. Relocation
- Active processes need to
be able to be swapped in
and out of main memory
in order to maximize
processor utilization
- Relocate process to a
different area of memory
b. Protection
- Processes need to acquire permission to reference
memory location for reading/writing purposes
- Location of program in main memory is unpredictable
- Memory references generated by a process must be
checked at run time
c. Sharing
- To allow each process access to the same copy of the
program rather than have their separate copy
- Must allow controlled access to shared areas of memory
without compromising protection
d. Logical organization
- Programs are written in modules
Modules can be written & compiled independently
Different degrees of protection given to modules
(read-only, execute-only)
Sharing on a module level corresponds to the users
way of viewing the problem
- Segmentation = tool that most readily satisfies
requirements.
e. Physical organization
2. Memory Partitioning
a. Brings processes into main memory for execution by the
processor
- Involves virtual memory
- Based on segmentation & paging
b. Partitioning
- Used in several variations in some now-obsolete OS
- Does not involve virtual memory
I. Fixed-partitioning
Disadvantages
Program too big to fit a partition
Program needs to be designed with the
use of overlays
Main memory utilization is inefficient
Any program, regardless of size, occupies
entire partition
Internal fragmentation
Wasted space due to the block of data
loaded being smaller than the partition
Number of partitions specified at system generation
time limits the number of active processes in the
system
Small jobs will not utilize partition space efficiently
II. Dynamic Partitioning
Partition are of variable length and number
Process is allocated exactly as much as acquire
External Fragmentation
Memory becomes more & more
fragmented
Memory utilization declines
Compaction
Technique for overcoming external
fragmentation
OS shift processes so they are
contiguous
Free memory is together in one block
Time consuming & wastes CPU time
Placement Algorithms
Best-fit
Chooses the block that is closest in
size to request
First-fit
Begins to scan memory from the
beginning & chooses the first
available block that is large
enough
Next-fit
Begins to scan memory from the
location of the last placement &
chooses the next available block
that is large enough
III. Buddy Systems
comprised of
fixed & dynamic
partitioning
schemes
space available
for allocation is
treated as a
single block
Memory blocks
are available of
size 2K words
o 2L =
smallest
size block
o 2U =
largest size block
c. Addresses
- Logical
Reference to a memory location independent of the
-
d. Paging
- Partition memory into equal fixed-size chunks that are relatively
small
- Process divided into small fixed-size chunks of same size
Pages
Frames
- Chunks of a process
- Available chunks of memory
- Page Table
o Maintained by OS for each process
o Contains the frame location for each page in the process
o Processor must know how to access for the current process
o Used by processor to produce physical address
e. Segmentation