Dynamic Link Libraries
Dynamic link libraries (DLLs) are small programs that are designed to do only one or a few specific functions. Since they are designed to be used in specific circumstances, they are only loaded and used as needed. This method of using smaller, independent, and inactive applications that are called when needed saves RAM space for the application itself.
The most common experience people have with DLLs are device drivers, such as printers, scanners, and digital cameras. If you are using a raster image processing software that uses a lot of RAM to function, such as Photoshop, launching the application loads a lot of RAM intensive components. These components are necessary for Photoshop to function normally, so many of the occasionally used applications, like device drivers or certain filters, are made into DLLs. Photoshop is fully loaded into RAM to provide processing speed, however, the printer, scanner, and digital camera DLLs are not.
When you tell the program that you want to scan something, or if you attach a camera to the computer to download images, the brief pause between making the call and being able to perform the action is the computer loading the DLL into RAM. Depending on the size of the file, it could take some time, but they are typically designed to be as efficient as possible.
Once the DLL is loaded, you can make scans or download images. When you are done, depending on how the application handles the DLL, it may or may not be dropped from RAM. Whether it remains in RAM is also a factor of how the DLL was written. Unmounting the device can remove the DLL from RAM as well. Sometimes they are removed immediately if they use too much memory, other times they stay in RAM until the program is restarted.
In SQL, DLLs may be used for accessing tables, data, or to perform specific functions that the programmer knows will be rarely used. A compiled runtime executable file can be composed of many DLLs, all designed to increase the efficiency of RAM usage, processing power, or to increase query times.
Programming with DLLs is necessary, but it also requires a delicate balance to make sure that not too many of a database’s functions are allocated to DLLs. DLLs are more likely to cause corruption issues and crashes because of their independent nature from the rest of the program. It is important to thoroughly test DLL actions against other DLLs and system functions, which can be time consuming.
There are applications that allow you to look into an executable file to examine the DLLs that it contains. It is important to note that not all DLLs are contained in an executable file. A DLL can exist outside of an executable as an independent application that could be shared by other programs. If this is the case, the compiled application will have calls to the file if it is needed. If it is called, it is them loaded into RAM, otherwise it remains dormant.