0

I wonder how the libc.so.6 is handled in memory when a program includes it . I understand its a dynamic lib file and only stored once but I was really surprised how huge this file is.

This syntax directs the stream to myoutput.txt

objdump -d libc.so.6 &> /home/john/myoutput.txt

I opened it - well its over 18 MB in size and over 300 000 rows.

So - is all of this loaded into ram when a program uses it or just pieces?

java
  • 1,165
  • 1
  • 25
  • 50
  • How large is the original file? That's of more interest. – Charlie Burns Dec 10 '14 at 22:10
  • 3
    Well, it is mapped into your address space if used by your program or one of its shared libraries (recursively). Also, its initialization will create a process-private copy of its modified data. But most pages will only be paged in when needed. BTW: It's used by just about all programs running, so the impact of its static size is negligible, as they can and do share all non-modified parts. And naturally, `objdump` might result in orders of magnitude bigger or smaller output than its input anyway. – Deduplicator Dec 10 '14 at 22:12
  • @Deduplicator - ok didnt think of that - that virtual mem. taking care of it. A lot of pages may be "sleeping" in the swap-file (not occypying RAM) – java Dec 11 '14 at 14:32
  • Or even never making it to the swap-page, as there never was any reason to load them from the file at all. – Deduplicator Dec 11 '14 at 19:59

0 Answers0