One guarantee is that if you add RAM, you’ll find a way to use it up. Between running more programs and more complex programs, RAM is always a resource that is in short supply.
External memory fragmentation is the loss of usable memory space due to holes between allocated blocks of variable sizes.
The 50% rule states that, on average, one hole exists for every 2 occupied blocks. It makes no assumption as to the size of a given hole, or block, in memory – so it makes no assumptions as to “wasted space”.
When there isn’t a large enough hole available for a request the process can either be delayed until more memory is released or two possible actions may be taken to create more space:
- Swapping is the temporary removal of a module from memory. Dynamic relocation is necessary so that the module can be placed into a different location without modification. Swapping is generally considered to be slower than compacting because of the speed of the drive. HDD are much slower than SSD, but even SSD is slower than RAM.
- Memory compaction is the shifting of modules in memory, generally in one direction, to consolidate multiple non-contiguous holes into one large hole.
Linking Objects
Linking is the act of resolving external references among object modules. Programs may consist of numerous external modules, not all of them are needed every time the program runs.
Modules can be linked to statically, which means they must be loaded while the program loads so the linking can occur, or dynamically so the program can access it as needed while it is running.
Windows’ DLLs (Dynamic Link Libraries) are an example of dynamically loaded libraries, some of them system wise which allow programs to use a library.
DLLs
Shared libraries can cause an issue. The idea was by programs sharing libraries, there would be less code to write and programs wouldn’t take up so much overall space on the HDD. Compare this to some modern games which take over 200GB to load.
Sharing is the act of linking the same copy of a module to multiple other modules. Sharing improves memory utilization by allowing multiple processes to share common routines or services (Ex: compilers, editors, word processors), or common data (Ex: dictionaries). Sharing is possible under both static and dynamic linking.
In Windows this was known as DLL Hell for many years. The problem arose with different versions of the same library, sometimes an older one would be overwritten.
Sometimes a program would be uninstalled, and it would remove a library that other programs still needed.
Sometimes a new version wouldn’t run exactly like an old version, and there would be issues.
Managing Insufficient Memory was originally found on Access 2 Learn