Dynamic Linking RAM usage?
On windows, dynamic linking is typically done with dll files. When the os loads a program into RAM, it loads a copy of each dll the program uses, right? When two programs use the same dll, do they both get a separate copy of the dll? I don't know why, but I was thinking about it, and it seems like it'd be a huge memory waster if each program had copies of the same libraries loading into RAM simultaneously. Do modern operating systems like windows
take care of this, or do they really waste that much memory? It seems like they could make the os set up an area of RAM for this purpose when the os boots up, right?
Meh.
/Discuss
It's not really a waste.
You know that every program on a protected mode x86 operating system can access 4gigs of memory, so the amount of memory that windows will have to reserve in it's page file or in ram is the same with or without dlls loaded. Of course not all of this memory has to be allocated when the program starts, but chances are very high that a program that runs on windows will need to access it's api's and that's why they load them anyway.