Memory map of shared libraries, etc.

Memory map of shared libraries, etc.

Post by Raymond To » Wed, 29 Jul 1998 04:00:00



Gentlepeople,

I'm trying to increase the heap size of CMUCL, and, while I think this
is pretty straight forward, I need to know where linux mmaps shared
libraries and other things.  

Doing a cat /proc/<lisp-id> shows something like this:

01000000-02101000 Read-only space
02101000-03800000  "

05000000-052ae000 Static space
052ae000-05fff000  "

08048000-0805a000 Unknown
0805a000-0805b000  "
0805b000-08266000  "

09000000-09001000 Dynamic 0
09001000-29000000  "

40000000-40005000 Unknown
40005000-40006000  "
40006000-40007000  "
40007000-40008000  "
40008000-4000e000  "
4000e000-40010000  "
40010000-40012000  "
40012000-40013000  "
40013000-400a6000  "
400a6000-400ac000  "
400ac000-400de000  "
400de000-400e2000  "

50000000-50100000 Control stack
60000000-60100000 Binding stack
bfffd000-c0000000 Unknown

The labeled sections are segments of memory that I know CMUCL has
allocated.  The other pieces are from Linux.

What is located at the sections marked unknown?

I assume one is for shared libraries.  Don't know what the others
could be used for.

Thanks,
Ray

 
 
 

Memory map of shared libraries, etc.

Post by Linus Torval » Wed, 29 Jul 1998 04:00:00




Quote:

>The labeled sections are segments of memory that I know CMUCL has
>allocated.  The other pieces are from Linux.

>What is located at the sections marked unknown?

>I assume one is for shared libraries.  Don't know what the others
>could be used for.

One thing to do is to run the same thing under a later 2.1.x kernel,
simply because the information from /proc/xxx/maps is so much clearer
(it gives file names and not just the inode numbers).  That should give
you a pretty good idea of which areas are shared libraries etc (this is
an example of how "cat" got loaded):


        08048000-0804d000 r-xp 00000000 08:01 14393      /bin/cat
        0804d000-0804e000 rw-p 00004000 08:01 14393      /bin/cat
        0804e000-08051000 rwxp 00000000 00:00 0
        40000000-40005000 r-xp 00000000 08:01 20524      /lib/ld-linux.so.1.9.6
        40005000-40006000 rw-p 00004000 08:01 20524      /lib/ld-linux.so.1.9.6
        40006000-40007000 rw-p 00000000 00:00 0
        4000b000-4009e000 r-xp 00000000 08:01 20485      /lib/libc.so.5.3.12
        4009e000-400a4000 rw-p 00092000 08:01 20485      /lib/libc.so.5.3.12
        400a4000-400d6000 rw-p 00000000 00:00 0
        bfffd000-c0000000 rwxp ffffe000 00:00 0

ie the 0x400xxxxx area is where the dynamic loader and the libraries got
loaded, while the stack is growing down from 0xc0000000, and the binary
itself and the associated heap is starting at 0x080xxxxx.

                Linus

 
 
 

Memory map of shared libraries, etc.

Post by Raymond To » Thu, 30 Jul 1998 04:00:00




    >>
    >> The labeled sections are segments of memory that I know CMUCL has
    >> allocated.  The other pieces are from Linux.
    >>
    >> What is located at the sections marked unknown?
    >>
    >> I assume one is for shared libraries.  Don't know what the others
    >> could be used for.

    Linus> One thing to do is to run the same thing under a later 2.1.x kernel,
    Linus> simply because the information from /proc/xxx/maps is so much clearer
    Linus> (it gives file names and not just the inode numbers).  That should give

Good suggestion, but doesn't 2.1.x require glibc?  If so, I'm not
quite ready to take the plunge because the support of glibc in CMUCL
is finished yet.

Anybody have a patch to 2.0.x to make /proc/xxx/maps to print the same
info as 2.1.x? :-)

    Linus> you a pretty good idea of which areas are shared libraries etc (this is
    Linus> an example of how "cat" got loaded):


    Linus>   08048000-0804d000 r-xp 00000000 08:01 14393      /bin/cat
    Linus>   0804d000-0804e000 rw-p 00004000 08:01 14393      /bin/cat
    Linus>   0804e000-08051000 rwxp 00000000 00:00 0
    Linus>   40000000-40005000 r-xp 00000000 08:01 20524      /lib/ld-linux.so.1.9.6
    Linus>   40005000-40006000 rw-p 00004000 08:01 20524      /lib/ld-linux.so.1.9.6
    Linus>   40006000-40007000 rw-p 00000000 00:00 0
    Linus>   4000b000-4009e000 r-xp 00000000 08:01 20485      /lib/libc.so.5.3.12
    Linus>   4009e000-400a4000 rw-p 00092000 08:01 20485      /lib/libc.so.5.3.12
    Linus>   400a4000-400d6000 rw-p 00000000 00:00 0
    Linus>   bfffd000-c0000000 rwxp ffffe000 00:00 0

    Linus> ie the 0x400xxxxx area is where the dynamic loader and the libraries got
    Linus> loaded, while the stack is growing down from 0xc0000000, and the binary
    Linus> itself and the associated heap is starting at 0x080xxxxx.

Cool.  So my 0x08048000 section is the code itself, shared libraries
go at 0x40000000, the C stack grows down from 0xc0000000.

Is it possible to move the shared library section to somewhere else?

Thanks for the great info (and the great system!)

Ray

 
 
 

Memory map of shared libraries, etc.

Post by Wolfram Gloge » Thu, 30 Jul 1998 04:00:00



> Good suggestion, but doesn't 2.1.x require glibc?

Most definitely not !  As Linus has outed himself with his
/proc/maps/<cat-pid> output, he is still running the ancient
libc-5.3.12 C library version :-).

Regards,
Wolfram.

 
 
 

Memory map of shared libraries, etc.

Post by Raymond To » Thu, 30 Jul 1998 04:00:00



    >> Good suggestion, but doesn't 2.1.x require glibc?

    Wolfram> Most definitely not !  As Linus has outed himself with his
    Wolfram> /proc/maps/<cat-pid> output, he is still running the ancient
    Wolfram> libc-5.3.12 C library version :-).

Cool!  I thought I had tried it once before long ago and it wouldn't
even boot.  I obviously messed something up when I did this. :-)

Ray

 
 
 

1. Shared Memory,Memory mapped files and Threads

1. If thread 1 in a multithreaded application attaches to a shared memory
segment is it possible to guarantee that thread2 will not overwrite this shared
memoey segment?

2. Same question as it relates to memory-mapped file.

3. Can device drivers be used to achieve thread level insulation from shared
memory or memory mapped files?

4. What are the advantages of using memory-mapped files vs. shared memory?
(Issues such as system limits, process limits, size, performance, etc.)

5. Can you direct me to relevant material on the above mentioned topics (books,
web-sites, etc.)

Thank you.

Sincerely,

Sanjay Shrivastava.

2. AIX BOOT

3. Shared Memory v. Mapped Memory

4. dosemu0.49pl3 and MSDOS 6

5. Shared memory, memory mapped files and threads

6. make world 4.3-stable

7. chat script won't detect BUSY signal

8. Conflict with shared memory and memory map

9. Shared Memory vs. Memory Mapped

10. Solaris Shared Memory, Shared Libraries and Heap

11. Shared Library/Shared Memory

12. Will strip(debug shared library) == nodebug shared library ?