|
|
|
|
|
by slabity
617 days ago
|
|
Even if the OS could perfectly deduplicate pages based on their contents, static linking doesn't guarantee identical pages across applications. Programs may include different subsets of library functions and the linker can throw out unused ones. Library code isn't necessarily aligned consistently across programs or the pages. And if you're doing any sort of LTO then that can change function behavior, inlining, and code layout. It's unlikely for the OS to effectively deduplicate memory pages from statically linked libraries across different applications. |
|
I guess much of this is why its hard to use shared libraries in the first place.