* Paul Michael Tevis said: > > > No memory cost? Care to rethink that again? > > > > I have been rethinking it, but as far as I can tell from reading the ldso > > source and from knowing a little bit about how linkers work, there is no > > RAM benefit from using shared libraries. The benefit is on the maintenance > > side, having shared code sitting in a single file. If you can point me to > > a page that explains where I'm wrong (if I am), then please do. > > I forget exactly how this works. Does Linux only maintain one in-memory > copy of read-only data (i.e. the code and ro segments of an executable)? > I know that various OS's do this, and I don't remember if linux does. If > so, then dynamically linking won't save you any RAM, since the library > code would be ro anyway. If not, then it might. Linux uses copy-on-write memory pages that are shared until written, AFAIR. And with the code residing in shared libraries it's in ro segments. I might be wrong, but I think that's the way it is on linux. marek
Attachment:
pgpj8UqzT4xx3.pgp
Description: PGP signature