1825734 Members
2554 Online
109687 Solutions
New Discussion

Re: shminfo

 
derek b smith_1
Regular Advisor

shminfo

after looking at ipcs -ma I have a few NATTACH at zero so I then run the shminfo c program to tell me if there is a active process associated with that segment.... all if fine and dandy then I remove it. My question is when I run is w/out any switches ./shminfo it give me this as attached. What are all the FREE data rows and in general how do I read this output?
2 REPLIES 2
Ermin Borovac
Honored Contributor

Re: shminfo

AFAIK it is not safe to remove shared memory segment if NATTCH is zero. Process may initialise the segment and exit, and other related processes may need to attach to the segment in the future (even though no processes are attached to the segment at the moment).

I think it's best to leave it unless you are having specific problems (database can't start etc).

In the output of shminfo

FREE refers to unallocated areas
SHMEM refers to shared memory
OTHER refers to memory-mapped files
Sridhar Bhaskarla
Honored Contributor

Re: shminfo

Hi Derek,

"ipcrm"ing the segments is only to be done as a last resort as you simply wouldn't know whether that segment is being used or not. Unless you don't have your application running on the system and you are sure about removing it, you cannot remove it based on the outputs. ipcs -ma will show you CPID (PID that created the segment) and LPID (PID that last accessed the segment). Along with them not running and NATTACH being 0 *may* assist you determine the probable candidates.. but again based on the condition that the system is not running anything.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try