Operating System - HP-UX
1752749 Members
4853 Online
108789 Solutions
New Discussion юеВ

Shared library mapping to memory

 
SOLVED
Go to solution

Shared library mapping to memory

Hi,

When I see my process's memory region by GlancePlus,
I find that all my shared libraries are mapped at MEMMAP/Priv area.

However, when I run utils provided by others, such as pxdb, the shared libraries they use are mapped as MEMMAP/Shared.

Would anyone tell me how to assing shared library's image to shared memory?

My environ info:
OS:HP-UX 11.0

Tnanks in advance, Takeshi Sato
Model:A500
takeshi
3 REPLIES 3
Jean-Louis Phelix
Honored Contributor
Solution

Re: Shared library mapping to memory

Hi,

If your shared libs have write access, they will be private. If they are read-only they should be shared. Check permissions ...

Regards.
It works for me (┬й Bill McNAMARA ...)

Re: Shared library mapping to memory

Thank you Jean-Louis,
I followed your question and I got it. MEMMAP/Shared.

Please let me explain the reason I asked the question in first place.

I have two same processes running which links a lot of shlibs.
The first one takes a quite long time to start up, (to reach the main() ) which I expected. Maybe it is taking a lot of time to load the libraries.

The problem was that the second one takes about the same time to start up.

I had two assumptions here.
1) Before reaching main(),
all the shlibs are loaded from file system. ("deferred" are set but I understand that loading is done at the startup anyway)

2) Once a shared library is loaded, it will not be loaded again from filesystem. Even if another process which uses the same shared library is started. So the second process starts up quicker.

And the result after MEMMAP/Shared? The same.
The second process takes about the same time to startup.

Would Jean-Louis or anyone tell me why this is the case?
Or am I wrong whole together?
Maybe a task besides loading shared libraries is taking time?

Thanks again in advance.
Hope one day I will be in place to answer the questions.

Takeshi Sato
takeshi
Jean-Louis Phelix
Honored Contributor

Re: Shared library mapping to memory

Hi,

I'm not really an expert in shared libs, but perhaps you could have a look at some commands and docs like :

- fastbind : improves Shared Library Start-Up Time ...

- chatr : so many options ...

- HP-UX Linker and Libraries User's Guide at http://www.docs.hp.com/hpux/onlinedocs/B2355-90654/B2355-90654.html

Regards.
It works for me (┬й Bill McNAMARA ...)