29-05-2012, 03:31 PM
Memory Management
Memory Management.ppt (Size: 612.5 KB / Downloads: 49)
Subdividing memory to accommodate multiple processes
Memory needs to be allocated efficiently to pack as many processes into memory as possible
Memory Management Requirements
Relocation
Programmer does not know where the program will be placed in memory when it is executed
While the program is executing, it may be swapped to disk and returned to main memory at a different location (relocated)
Memory references in the code must be translated to actual physical memory address
Protection
Processes should not be able to reference memory locations in another process without permission
Impossible to check absolute addresses in programs since the program could be relocated
Must be checked during execution
Operating system cannot anticipate all of the memory references a program will make
Sharing
Allow several processes to access the same portion of memory
Processes executing the same program can access the same copy of the code
it is more efficient than allocating private copies
Logical Organization
Programs are written in modules
Modules can be written and compiled independently
Different degrees of protection given to modules (read-only, execute-only)
Share modules
Physical Organization
Memory available for a program plus its data may be insufficient
Overlaying allows various modules to be assigned the same region of memory
Programmer does not know how much space will be available
Placement Algorithm with Partitions
Equal-size partitions
because all partitions are of equal size, it does not matter which partition is used
Unequal-size partitions
can assign each process to the smallest partition within which it will fit
queue for each partition
processes are assigned to minimize wasted memory within a partition
Segmentation
All segments of all programs do not have to be of the same length
There is a maximum segment length
Addressing consist of two parts - a segment number and an offset
Since segments are not equal, segmentation is similar to dynamic partitioning