共享库加载到内存的次数

时间:2014-02-04 20:23:44

标签: shared-libraries

是否有人知道共享库加载到内存的次数是多少? 例如,如果我执行ProgramAProgramB都使用libmyLib.so,我同意磁盘上只有一个副本,但内存是什么?

PS:窗户怎么样?

1 个答案:

答案 0 :(得分:0)

只有一个共享库实例在Program A& B

检查article上的内容,

Shared libraries can save memory, not just disk space. The kernel can keep a 
single copy of a shared library in memory, sharing it among multiple applications.
So, not only do we only have one copy of printf() on the disk, we only have one 
in memory. That has a pretty noticeable effect on performance.