Concept of Overlays
- In certain situations, an application to be executed may requires more memory space than the capacity of the memory.
- In order to solve this problem, the concept of overlays is used.
- In this concept, the object program or an application consists of number of separate modules called overlays.
- An application may not require all these modules, or overlays at the same time. Therefore these overlays can be loaded individually and selectively into the same area of memory .
- Thus the concept of overlays enables a process to be larger than the amount of memory allocated to it. In such a way only those instructions and data is kept in the memory that are needed at any given time. If other instructions are needed, they are loaded into spa that was occupied previously by instruction that are no longer needed.
- This concept requires the need to add a small module in the application program called overlay driver for overlay management. This overlay driver plays a role in removing the modules that are not required and also helps in loading the modules that will be required in the succeeding stages of the execution of the application.
- For example, an application consist of four modules A, B, C and D. The modules, A and B are required throughout the execution of the application. The modules C and D are not required simultaneously. The module C is required first and the module D is required after completion of the task of module C.
- The size of memory is 64MB. Operating System itself requires 8MB memory space. User applications can use the remaining 56MB memory space.
The application to be loaded has four parts :
Module A 24 MB
Module B 4MB
Module C 12MB
Module D 18MB
- All these four modules together require 58MB memory whereas only 56MB of space is available. Module A and B that are required to be loaded throughout the execution time occupy 28MB space. Overlay driver occupies 1MB space and the remaining 27MB can be used to load module C and D one after the other.
- The major disadvantages of overlaying is the extensive programmer involvement in the process. A programmer has to identify overlay segment. He should have complete knowledge of the structure of the program, its code, data structures.
Nice post. I used to be checking constantly this
blog and I am impressed! Extremely useful info specially the closing section 🙂 I take care of such info much.
I used to be seeking this certain info for a very lengthy
time. Thank you and good luck.