Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



> 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?


> 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


Wouldn't KSM help with that? If the security concerns aren't a factor.


> For that we have Docker these days

Or just a proper package manager, like nix.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: