Академический Документы
Профессиональный Документы
Культура Документы
that are waiting to be brought into memory for execution. Select one process from input queue to load it into memory for execution. After execution (terminates) memory space becomes available.
Address binding of instructions and data to memory addresses can happen at three different stages:
Compile time: If memory location known a priori,
absolute code can be generated. Since it starts from that location. Load time: Must generate reloadable code if memory location is not known at compile time. Execution time: Binding delayed until run time if the process can be moved during its execution from one memory segment to another. Need hardware support for address maps (e.g., base and limit registers).
The concept of a logical address space that is bound to a separate physical address space is central to proper memory management.
Logical address : Generated by the CPU; also referred to as
Logical and physical addresses are the same in compiletime and load-time address-binding schemes; logical (virtual) and physical addresses differ in execution-time address-binding scheme. The set of all logical address generated by a program.
The run-time mapping from virtual to physical addresses is done by the memory management unit (MMU), which is a hardware device. The user program deals with logical addresses; it never sees the real physical addresses.
Two different types of addresses:
Logical: range 0 to max. Physical: range R+0 to R+max; where R is a base value.
The user generates only logical addresses and thinks that the process runs in locations 0 to max.
In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory. Example: Dynamic relocation using a relocation register.
Dynamic loading is used to obtain better memory space. An unused routine will never been used.
It is particularly useful when large amount of code. It does not requires any special support from the OS.
A process can be swapped temporarily out of memory to a backing store, and then brought back into memory for continued execution. Take Round robin scheduler as example, when time quantum expires the memory swap out the process and swap in another process. Roll out, roll in In priority-based scheduling algorithms; lower-priority process is swapped out if higher-priority process arrives and wants service, can be loaded and executed.
A process that is swapped out will be swapped back into the same memory space that it occupied previously. Normally CPU maintains the ready queue for the backing store.
When CPU needs it calls the dispatcher. If we want to swap, it should be completely idle.
Like without any pending i/o requests.
The memory can be divided into several fixed sized components is called Partitions.
The block of available memory called as Hole. This may be at various sizes scattered throughout the memory.
To satisfy the request of size n from a list of free holes. There are three approaches.
First fit: Allocates the first hole that is big enough. Best fit: Allocates the smallest hole that is big enough, but it searches the entire list. It produces the smallest leftover hole. Worst fit: Allocates the largest hole, it also searches the whole list. It produces the largest leftover hole.
Simply wasting of the memory. Memory that is internal to the partition but is not used called Internal fragmentation. Memory that is outside to the partition and is too small to used by any process is called External Fragmentation.
Divide physical memory into fixed-sized blocks called frames (typically between 512 bytes and 8192 bytes).
Paging is a memory management technique where Division of logical memory into blocks of same size called pages.
i.e., divide each process into same size of frames.
Page number p is an index into a page table that contains base address of each page in physical memory.
Page offset d is a displacement, combined with base address to define the physical memory address that is sent to the memory unit.
Hit ratio percentage of times that a page number is found in the TLB.
Hit ratio =
Memory protection implemented by associating protection bit with each frame Valid-invalid bit attached to each entry in the page table:
valid indicates that the associated page is in the
process logical address space, and is thus a legal page. invalid indicates that the page is not in the process logical address space