[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: general question about lazy loading of shared libraries

On Thu, 2004-11-18 at 15:45 -0800, Roland McGrath wrote:
> Directly-linked libraries are always loaded immediately on startup.  
> Their PLT relocations may be deferred until used, but we always load the
> libraries themselves and run their initializers at startup time.

To be clear here, any pages of the library that don't need to
be modified to do relocations are only "loaded" in a bookkeeping
sense - ld.so tells the kernel to mmap the library, and the kernel
assigns the library a place in memory, but pages won't actually
be read off disk until they are used.

One of the big ways that prelink reduces startup time is being
making the set of pages that need to be loaded to do relocations

I don't know an easy way to tell exactly what pages of the libraries 
you are using are touched and thus read off disk at start up... and it's
not even a well defined question - you can't tell if a page was 
read because of your app or because of another app.

You can get a general idea by looking at the display at top, roughly

 VIRT - amount of memory your app has loaded in the bookkeeping sense
 RES - subset of VIRT in memory at the current time
 SHARE - subset of VIRT that some other application is also using


Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]