Shared Libraries
When you use static libraries, the code is linked physically into your executable program. If you have a big library, say 10 megabytes, which is linked into a dozen programs, you will have 120 megabytes of disk space consumed. With today’s huge hard drives, that’s not too big of a deal, but you also have the libraries taking up those megabytes of space in each program’s memory. This is a much bigger problem. Memory is a scarce shared resource, so having duplicate copies of library code each occupying its own pages in memory can put stress on the memory system and cause paging.
Shared libraries were created to address this problem. Instead of copying the code into the programs, just a reference is included. When the program needs ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access