An Overlay is a part of an application, which has been loaded at same origin where previously some other parts of the program was residing. A program based on overlay scheme mainly consists of following:
a) A "root" piece which is always memory resident.
b) set of overlays.
Example:
Suppose total available memory is 140K. Consider a program with four subroutines: Read(), Function1(), Function2() and Display(). First, Read is invoked that reads a set of data. Based on this data set values, conditionally either one of routine Function1 or Function2 is called. And then Display is called to output results. Here, Function1 and Function2 are mutually exclusive and are not required simultaneously in memory. The memory requirement can be shown as in below figure-
Without the overlay it requires 180k of memory and with the overlay support memory requirement is 130K. Overlay manager/driver is responsible for loading and unloading on overlay segment as per requirement.
Overlay has some limitations which are as follows:
a) Require careful and time consuming planning.
b) Operating system provides the facility to load files into overlay region.
No comments:
Post a Comment