Lecture 7 Memory Management
Lecture 7 Memory Management
Lecture 7 Memory Management
g
Systems:
Internals Lecture 7
and Memory
Design
Principles Management
Joram M. Makasa
Table 7.1
Execution
stack
2.Protection
Processes need to acquire permission to reference memory
locations for reading or writing purposes (protection against
accidental or intentional)
Location of a program in main memory is unpredictable-
satisfying relocation makes it hard to satisfy protection
Memory references generated by a process must be
checked at run time in order to refer to only memory space
allocated to the process at run time
Mechanisms that support relocation also support protection
Memory protection requirement is satisfied by the processor
but not the OS , it cannot anticipate future memory
references this could be time consuming e.g. by aborting a
3.Sharing
Advantageous to allow each process access to the
same copy of the program rather than have their own
separate copy
Memory management must allow controlled access to
shared areas of memory without compromising
protection
Mechanisms used to support relocation support
sharing capabilities
4. Logical Organization
Memory is organized as linear(one dimensional address
space)
overlaying allows
various modules to be
Highest level of assigned the same
region of memory but
memory is time consuming to The flow of information
organization: program
between these two types
-main of memories is of concern.
memory( for The programmer cannot
temporary use manage memory because
-secondary of the above reasons
memory (for
permanent use) Movement of data between the two memories is a task of
memory management
Memory Partitioning
Memory management key operations is to bring
processes into main memory for execution by the
processor
involves virtual memory
Which is based on segmentation and paging
Partitioning- is a simpler technique
used in several variations in some now-obsolete
operating systems
does not involve virtual memory
Table 7.2
Memory
Management
Techniques
Minimizes wasted memory within a partition but partitions that do not get
their size of processes remain unused
Disadvantages
Thenumber of partitions specified at
system generation time limits the
number of active processes in the
system
Small jobs will not utilize partition space
efficiently
Dynamic
Partitioning
Partitions are of variable length and number
Process is allocated exactly as much memory
as it requires
This technique was used by IBM’s mainframe
operating system, OS/MVT
Dynamic
Partitioning
External Fragmentation
Compaction
Physical or Absolute
Extract the Use the segment Compare the offset, The desired
number as an index expressed in the physical address is
segment rightmost m bits, to
into the process the sum of the
number as the segment table to
the length of the
segment. If the offset starting physical
leftmost n bits of find the starting address of the
is greater than or
the logical physical address of equal to the length, segment plus the
address the segment the address is invalid offset
Summary
Memory management Memory
requirements partitioning
relocation
fixed
protection
sharing
partitioning
dynamic
logical
organization partitioning
physical buddy system
organization relocation
Paging Segmentation