5 ms·
A dynamically linked library need only have one image of itself in memory. If you are running a process that, for example, forks 128 of itself, do you want eve
by MuffinCups 3y ago
A dynamically linked library need only have one image of itself in memory.
If you are running a process that, for example, forks 128 of itself, do you want every library it uses to have a separate copy of that library in memory?
That's probably the biggest benefit. But it also speeds up load time if your executable doesn't have to load a huge memory image when it starts up, but can link to an already in-memory image of its library(s).
The only real downside is exporting your executable into another environment where the various dynamic library versions might cause a problem. For that we have Docker these days. Just ship the entire package.
- anotherhue 3y agoWouldn't KSM help with that? If the security concerns aren't a factor.
- never_inline 3y ago> If you are running a process that, for example, forks 128 of itself, do you want every library it uses to have a separate copy of that library in memory? Fork uses CoW, right?
- Expurple 3y ago> it also speeds up load time if your executable doesn't have to load a huge memory image when it starts up I'm not sure about Windows and Mac, but Linux uses "demand paging" and only loads the used pages of the executable as needed. It doesn't load the entire executable on startup
- kaba0 3y ago> For that we have Docker these days Or just a proper package manager, like nix.