Operating System - HP-UX
1834935 Members
2478 Online
110071 Solutions
New Discussion

Need to find process using up swap/shared memory

 
Luis Toro
Regular Advisor

Need to find process using up swap/shared memory

Hello,
I recently came across an issue where we were getting "Global Swap nearly full" messages, and the result was that the system had to be reset. With the help of this forum, I [believe] I've resolved the problem by adding another device swap area. I've also gained some knowledge on swap, reserve swap, shared memory and using ipcs. Now I need to do a post-mortem to find the process guilty of memory consumption. In doing an ipcs -mob I see that sybase is the biggest consumer of shared memory. However, I also notice that there is an entry for root at ID 0 with a SEGSZ of 1286144. On every other server, the first entry is OWNER root, but only 348 (in SEGSZ). I suspect this process may have put us over the top. How can I find out what the process is, and is this an anomoly (since on every server I've checked that first entry is constistently 348 SEGSZ) ?
Thank you
4 REPLIES 4
Olivier Decorse
Respected Contributor

Re: Need to find process using up swap/shared memory

Just use the "-a" option to display the PID of the process (CPID : the process ID of the creating process of the shared memory segment) :
ipcs -ma
and look at the 11 colomn, or directly with :
ipcs -ma | awk '{ print $11 }'

Olivier.
They say "install windows 2k, xp or better", so i install unix !
Elmar P. Kolkman
Honored Contributor

Re: Need to find process using up swap/shared memory

The CPID is a way, but only if it is still running, which is not necessarily true. The LPID is also something to look into. It is the PID of the process last accessing the shared memory segment. I would place my bets on this way...
Every problem has at least one solution. Only some solutions are harder to find.
Muthukumar_5
Honored Contributor

Re: Need to find process using up swap/shared memory

Did you check your swap memory information's with swapinfo there.

swapinfo -w ( to get warining's there )

It is not worth to check the partiticular Process swap / shared memory information with ipcs command.

Go for glance tool to do this effectively. It is specified one to know about this.

ipcs - displays certain information about active interprocess communication facilities and not as to specific process

-Muthu
Easy to suggest when don't know about the problem!
Luis Toro
Regular Advisor

Re: Need to find process using up swap/shared memory

Thanks for the info on the ipcs option, but I am still at a lost. I read a doc in this forum (can't access it to get the link...keep getting "Could not open URL" when I attempt a search) which explained swap, reserve swap, and ipcs. And how to determine the impact (on shared memory) of adding a new process. Also the fact that the shared memory in question had an ID of 0 leads me to believe that this is an OS related process that is taking up an abnormal amount of shared memory (relative to my other HPUX servers, and their first entry on the ipcs table)