Process memory layout
From: Sean (seanatpurdue_at_hotmail.com)
Date: 05/29/05
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: USB"
- Previous message: Rich Walker: "Re: USB"
- Next in thread: Kasper Dupont: "Re: Process memory layout"
- Reply: Kasper Dupont: "Re: Process memory layout"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 29 May 2005 14:45:40 -0500
I am wondering if my understanding that shared library is loaded at a
place between stack and heap space in memory space, like this:
Please correct me if my understanding is wrong.
--------------
| | high address
---------------
| stack |
| | |
| | |
| V |
| ... |
---------------
| bss of |
| shared lib |
---------------
| text of |
| shared lib |
---------------
| ... |
| heap |
---------------
| bss |
---------------
| initialized |
----------------
| app text |
----------------
| .... | low address
----------------
| kernel add |
----------------
Then, if an executable uses a function(say, asctime() ) in a shared
library(say, libc.so), the loader only resolves that function and loads
it to the process memory space, like the following figure.
If this is true, text/bss of a function is much smaller than a single
page, it seems the system performance is not optimized: this process
uses asctime() to occupy a hole page, and another process(which only
uses atoi() in its executable) uses atoi() to occupy another page. It
seems not efficient. I guess I misunderstood some points.
--------------
| | high address
---------------
| stack |
| | |
| | |
| V |
| ... |
---------------
| bss related |
| to asctime |
---------------
| text of |
| asctime() |
---------------
| ... |
| heap |
---------------
| bss |
---------------
| initialized |
----------------
| app text |
----------------
| .... | low address
----------------
| kernel add |
----------------
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: USB"
- Previous message: Rich Walker: "Re: USB"
- Next in thread: Kasper Dupont: "Re: Process memory layout"
- Reply: Kasper Dupont: "Re: Process memory layout"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|