1832595 Members
2902 Online
110043 Solutions
New Discussion

usage of shared memory?

 
usergroup.os.ux-3.4-iro
Occasional Contributor

usage of shared memory?

Hi,

I have a machine wich sometime go's "sleeping".
I think it is a memory problem, because of paging activity.

How can i detect the actual usage of shared memory ? ( is ipcs -ma the only way ?)
And second: Where in swapinfo output is the shared memory usage hidden?
5 REPLIES 5
Stefan Farrelly
Honored Contributor

Re: usage of shared memory?


To confirm you theory of paging activity then monitor if with;

vmstat 1 100

and look at the pi and po columns. If these are running >1 constantly then you are indeed paging and have run out of free memory.

ipcs -ma shows what shared memory is allocated to what user/pid. It doesnt show how much of the allocated memory is actually being used. I dont believe you can easily work this out, you would need to attach to the shared memory segment and add up whats currently being used, not easy, and requires some C programming.

swapinfo -mt does include shared memory usage, its under the memory line in the USED column. Its listed here because shared memory is locked in memory - it cant be paged out, thus its listed as used becuase it cant be used for paging activity. However, all processes locked into memory are in this column, not only shared memory.

Im from Palmerston North, New Zealand, but somehow ended up in London...
Zeev Schultz
Honored Contributor

Re: usage of shared memory?

swapinfo is all about paging/swapping.it doesn't care if it's shared or regular memory segment imho.ipcs -m -p + top (see resident memory sizes) or Glance should do the task.

regards

zeev.
So computers don't think yet. At least not chess computers. - Seymour Cray
Armin Feller
Honored Contributor

Re: usage of shared memory?

Hi,

I think the command 'ipcs -a -m' and Glance are the only ways to display the current shared memory usage.

If you have a software contract with HP, please contact your local HP-Support-Center and ask for following utilities 'shminfo' and 'kmeminfo'. This unsupported tools display a lot more infos of shared memory usage.

Like I know is there no option in 'swapinfo' about shared memory, you only get informations about swap space.

Best regards ..
Armin
Zeev Schultz
Honored Contributor

Re: usage of shared memory?

Or obtain shminfo from:
ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/
So computers don't think yet. At least not chess computers. - Seymour Cray
Mike Stroyan
Honored Contributor

Re: usage of shared memory?

Stefan,
Shared memory is not always locked into memory. A program with appropriate privileges can choose to lock it with shmctl(SHM_LOCK). Perhaps you use a lot of programs that choose to do that.