

To gain access to the improved functionality, the app’s developer must link the app's object files with the new version of the library. Also, when a static library is updated, its client apps don’t benefit from the improvements made to it. Applications with large executables suffer from slow launch times and large memory footprints. Figure 1 shows the memory usage of an app that uses functionality implemented in static libraries. Linking many static libraries into an app produces large app executable files. When an app is launched, the app’s code-which includes the code of the static libraries it was linked with-is loaded into the app’s address space. Note: Static libraries are also known as static archive libraries and static linked shared libraries.

Static libraries are collections or archives of object files. The kind of library that becomes part of an app’s executable file is known as a static library. A static linker collects compiled source code, known as object code, and library code into one executable file that is loaded into memory in its entirety at runtime. When an app is linked with a library using a static linker, the code that the app uses is copied to the generated executable file. Most of an app’s functionality is implemented in libraries of executable code. This article also provides an overview of the dynamic loader compatibility functions apps use to work with dynamic libraries at runtime. This article introduces dynamic libraries and shows how using dynamic libraries instead of static libraries reduces both the file size and initial memory footprint of the apps that use them. This feature contributes further to reduced launch times and efficient memory use. They also allow apps to delay loading libraries with special functionality only when they’re needed instead of at launch time. Using dynamic libraries instead of static libraries reduces the executable file size of an app. Reducing the size of an app’s executable file and minimizing its use of memory once it’s launched make the app launch faster and use less memory once it’s launched. Two important factors that determine the performance of apps are their launch times and their memory footprints. Next Previous Overview of Dynamic Libraries
