Memory is a vital element and central also. Memory can be thought of as an array of many locations having their own addresses.
About Memory Management
– The processes interact with each other through a sequence of read and write operations at the specific address spaces.
– The program is fetched by the operating system from the disk and stored in to the main memory.
– For the execution of the program it should be mapped with its absolute address and then loaded in to the main memory.
– Usually, the programs are stored on the disk as the executable files.
– That is why they have to be brought in to the main memory and assigned a process for executing.
– These processes are what that form the ready queue.
– Generally, it is from this ready queue, that the processes are fetched for execution.
– During all this processing, the addresses might be represented in a number of ways such as in symbolic form or source code address and so on.
– This symbolic address is bound to the address that can be relocated by the compiler.
– Next, these relocation addresses are bound to their absolute addresses by the linkage editor.
– Before storing a program in memory, the memory addresses that it is going to use must be bounded.
– Binding process is all about assigning the address to code and data.
– Binding can be done either at the compilation time or loading time or execution time.
– At the compilation time, if the memory location is known beforehand, generating the absolute code is possible.
– At the time of loading, if the location is not known, it has to generate relocatable addresses.
– All the modules must be kept on the disk and that too in a relocatable format for better memory utilization.
– Here, only the main program is fetched and executed.
– The other routines are called only if required and loaded and then executed.
– This kind of loading is termed as dynamic loading.
– The responsibility for dynamic loading lies on the user and not on the operating system.
– The purpose of the operating system is to just provide the library routines for its implementation.
Overlay Concept in Memory Management
What to do if the size of the process is larger than the available memory?
– This problem is overcome by using the technique of overlays.
– This implementation of this technique does not require support from the operating system.
– This technique is also implemented by the users.
– The whole program is divided in to sets of data and instructions in such a way that the required set can be loaded in to the memory when required and released when used.
– These sets are called overlays and program loads and unloads them.
– Formally, it can be defined as a part of the application program that is loaded at the same point where before some other parts of the program were loaded.
– A program that follows the overlay scheme consists of the following:
- A piece which always resides in the memory called root.
- Set of overlays
– Overlays serve as a means for the program for extending the physical memory that is very much limited.
– Mutual exclusion is an important concept related to the identification of the overlays.
– Mutual exclusion concept emphasizes on routines that do not invoke one another and therefore cannot be loaded in to the memory at the same time.
– Overlaying has made it possible for the programs to be larger than what the memory of the system can hold.
– Overlays are usually used in the embedded systems because they have a very limited physical memory i.e., their internal memory and they lack the virtual memory techniques.