What is "overlay" and what is its connection to memory?

Asked

Viewed 5,675 times

4

My college professor was talking about the term overlay in relation to memory. I was confused about this term.

I’d like to know what it is overlay and what connection it has with memory?

1 answer

4


This is used in primitive operating systems. The famous MS-DOS used this technique. Today it is only used in very limited devices, although some are becoming quite popular with the Iot.

In general the operating system does not have this for lack of space to create the virtual memory engine and mainly because it is made to run on hardware that does not provide facilities to manage memory in a simple, transparent and performance.

Think of the DLL. It is a way to break an executable into parts. The overlay It’s the same thing, it’s just done a little differently. In fact one of the advantages is to break the executable into parts to be distributed separately, in the past more useful than today since the floppy disks had very little space and was the most used means of transport.

The mechanism is useful when the executable is too large to fit in memory. It divides the code into parts that can be loaded alternately as needed. Usually there is code insertion to manage the need to load another part of the code that is not yet in memory.

In more complete operating systems in modern architectures there is the virtual memory system, so no matter if what you need is in physical memory or not, just say that it is in memory that exists beyond the limits of RAM, in general a part can be on disk. The application does not need to know any of this, for it there is a huge memory limited in 4GB in 32 bits or as the OS allows up to the limit of 16EB in 64 bits. The OS manages if it needs to put a part in secondary storage or will keep in RAM.

To virtual memory is a management that determines where the memory pages (commonly 4KB blocks) are in memory. These pages may be spread throughout the RAM or may be elsewhere. In thesis it may even be on another machine. It controls this, it is not the problem of the user or the developer of the application. It is an abstraction to facilitate a lot of things, including protecting areas of memory and meeting the applications' memory allocation requests consistently.

In general a modern executable is usually loaded with a technique of memory mapped file, which makes it transparent whether it’s on disk or RAM. Physically a chunk of the executable needs to be in the RAM to be executed, so whenever you try to access and fail, a page fault (Wikipedia) and the OS will bring the page that should be on disk to the RAM. Therefore a code or data that is being used in two different processes does not need to be duplicated, physically it only exists once despite being referenced in two virtual memory spaces. Therefore it is complicated to measure application memory consumption, there is physical consumption of RAM, total consumption and virtual consumption.

The overlay is a virtual memory of poor :) It is not so sophisticated, serves only for the separation of part of the code, nothing more.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.