Operating System - HP-UX
1830156 Members
7486 Online
109999 Solutions
New Discussion

monitoring the use of shared memory

 
Simon Jespersen
Frequent Advisor

monitoring the use of shared memory

Hi, i would like to kbow if it possible to show the use of shared memory on hpux 11.11 model rp4440.
I will not use the galnce utility om looking for a oneliner to use in a script.

i coud be even better if it was possible to get a list showing processes using shared memory and total amount of shared memory in use.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: monitoring the use of shared memory

Hi Simon:

# ipcs -ma

...offers a view of shared memory segments.

Regards!

...JRF...
Marco Santerre
Honored Contributor

Re: monitoring the use of shared memory

is ipcs what you are looking for?

ipcs -m -a will show you all the entries that you have for shared memory.
Cooperation is doing with a smile what you have to do anyhow.
Simon Jespersen
Frequent Advisor

Re: monitoring the use of shared memory

It is very nice, but is it possible to get the total use of shared memory. I have assigned 2 gb to shared memory and i would like to see if it all are in use. Another question is
does segsz show the value in kb.

Simon Wickham_6
Regular Advisor

Re: monitoring the use of shared memory

Hi,

Run ipcs -moba command to look at the NATTCH columns and the DTIME columns.

Regards,
Simon
Bill Hassell
Honored Contributor

Re: monitoring the use of shared memory

ipcs has a lot of options to see the various features of shared memory such as the creator (CPID), the last process to attach to a given segment (LPID), segment size (in bytes, SEGSZ), and so on. However, most requests to monitor shared memory are the result of an "out of memory" condition and ipcs is not very useful here. ipcs cannot show the fragmentation of the shared memory map, a critical problem with 32bit programs. Because there is just one single map for shared memory (which includes memory mapped files and other signals), a process will fail when there is plenty of RAM but no contiguous piece of memory in this map that will satisfy the program's request.

To see how shared memory is actually mapped, get a copy of shminfo from:

ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/

You can then see all the components and the map address they are using. If you have several processes creating separate shared memory segments, stopping and restarting these programs will quite often create small fragments and prevent the process from restarting.

The other reason for lack of shared memory is due to the use of kill -9. The -9 option is extremely disruptive in that the program is terminated WITHOUT any chyance to cleanup allocated resources such as shared memory. These segments will remain allocated until a reboot or removed with ipcrm (a fairly tricky command to use).

64bit programs do not have any meaningful restrictions on shared memory usage but if you cannot recompile your programs, you may want to look at memory windows to create private maps. See:

http://docs.hp.com/en/943/memwn1_4.pdf


Bill Hassell, sysadmin