Have you heard about DLL relocations?

Recent bumps in RAM prices reminded me of how software saved memory on PCs in the 90s, for example using DLL relocation.
RAM in the 90s was expensive and Windows was heavily optimized to save memory. I remember how upgrading my 486 from 1 to 4 MB drastically speeded up boot time on my Windows 95 machine.
DLL is a way to use shared code and resources between applications
Whenever you start a process in Windows, it gets its own virtual address space. 32-bit Windows applications would typically load at 0x00400000.
Each process in Windows executes its binary code and uses functions from Dynamically-Link Libraries. DLLs were designed to load at preferred base address, so memory pages could be shared between processes.
For example, shell32.dll, a library containing common Windows functionality, such as dialog windows (open/save dialog), icons and other useful resources would typically load at 0x77F60000.

Applications call functions exported by the DLL.
The whole idea of DLLs is that Windows can share memory pages between processes, thus not needing to duplicate them.
When no relocation is needed, Windows can map the same memory page to multiple processes, thus reducing RAM usage.
No 2 DLLs may pre-occupy the same address range in the same process

Let's imagine that two libraries are compiled to load at the same address.
How to load two libraries at the same address? Would that point to the first, the second or any other library requested by the program?
DLL relocation to the rescue
The solution, called DLL relocation, loaded the second library at a different address. Then, Windows would patch absolute addresses inside the DLL image after it has been loaded into memory.
The operating system uses then a relocation table to resolve addresses after loading.
Today's landscape
Today applications ship with runtimes embedded. Many applications consume more memory and disk than Windows 95 itself. In the old days a few megabytes mattered. Maybe it's time we started saving on memory a little more.