cancel
Showing results for 
Search instead for 
Did you mean: 

ipcs shared memory

madhu22
Occasional Visitor

ipcs shared memory

Hi

 

OS version -v1

 

we are facing issue in DB for nearly 30 days.

 

instead of adding new physical memory , I have some doubts to be clarified.

 

is it possible to remove the shared memory .

 

I have pasted the ipcs output,

 

$ ipcs -m

IPC status from /dev/kmem as of Fri Jan  4 19:52:34 2013

T         ID     KEY        MODE        OWNER     GROUP

Shared Memory:

m          0 0x411818ab --rw-rw-rw-      root      root

m          1 0x4e0c0002 --rw-rw-rw-      root      root

m          2 0x411c0ba4 --rw-rw-rw-      root      root

m       1027 0x06347849 --rw-rw-rw-      root      root

m       9220 0x0c6629c9 --rw-r-----      root      root

m       1029 0x491003a9 --rw-r--r--      root      root

m      82950 0x1550f7c4 --rw-r-----    oracle  oinstall

m          7 0x5e140004 --rw-------      root      root

m       1032 0x64541651 --rw-r--r--     oni01    onidev

 

 

$ ipcs -mob

IPC status from /dev/kmem as of Fri Jan  4 19:52:55 2013

T         ID     KEY        MODE        OWNER     GROUP NATTCH      SEGSZ

Shared Memory:

m          0 0x411818ab --rw-rw-rw-      root      root      0        348

m          1 0x4e0c0002 --rw-rw-rw-      root      root      1      61760

m          2 0x411c0ba4 --rw-rw-rw-      root      root      1       8192

m       1027 0x06347849 --rw-rw-rw-      root      root      2      65544

m       9220 0x0c6629c9 --rw-r-----      root      root      2   18994744

m       1029 0x491003a9 --rw-r--r--      root      root      0      22908

m      82950 0x1550f7c4 --rw-r-----    oracle  oinstall     15 1593843712

m          7 0x5e140004 --rw-------      root      root      1        512

m       1032 0x64541651 --rw-r--r--     oni01    onidev      0          4

 

$ ipcs -ma

IPC status from /dev/kmem as of Fri Jan  4 19:53:29 2013

T         ID     KEY        MODE        OWNER     GROUP   CREATOR    CGROUP NATTCH      SEGSZ  CPID  LPID   ATIME    DTIME    CTIME

Shared Memory:

m          0 0x411818ab --rw-rw-rw-      root      root      root      root      0        348   642   642 14:47:21 14:47:21 14:47:15

m          1 0x4e0c0002 --rw-rw-rw-      root      root      root      root      1      61760   642   642 14:47:18 14:47:21 14:47:15

m          2 0x411c0ba4 --rw-rw-rw-      root      root      root      root      1       8192   642   654 14:47:18 14:47:15 14:47:15

m       1027 0x06347849 --rw-rw-rw-      root      root      root      root      2      65544  1711  1782 14:48:10 14:48:08 14:48:03

m       9220 0x0c6629c9 --rw-r-----      root      root      root      root      2   18994744  1738 17595 16:07:24 16:11:49 14:48:07

m       1029 0x491003a9 --rw-r--r--      root      root      root      root      0      22908  1716  1782 19:53:01 19:53:01 14:48:09

m      82950 0x1550f7c4 --rw-r-----    oracle  oinstall    oracle  oinstall     15 1593843712 12253 17544 19:52:20 19:52:21 17:04:57

m          7 0x5e140004 --rw-------      root      root      root      root      1        512  2063  2063 14:48:32 no-entry 14:48:32

m       1032 0x64541651 --rw-r--r--     oni01    onidev     oni01    onidev      0          4 23141 12432 12:30:47 12:30:47 16:42:04

$

$

 
glance output




Total VM :   3.5gb   Sys Mem  :   1.2gb   User Mem:   2.4gb   Phys Mem:   6.0gb

Active VM:   2.7gb   Buf Cache:   1.5gb   Free Mem:   920mb

 

 

total physical memory is 6 GB.

 

user memory is 2.4 gb.

 

 

is it possible to clear the shared memory from the above outputs.

 

regards

 

Madhu

5 REPLIES
bobjh
Advisor

Re: ipcs shared memory

Doesn't ipcrm(1) work?

Patrick Wallek
Honored Contributor

Re: ipcs shared memory

ipcrm may work, but you really have to be careful when deleting share memory segments.  If you delete the wrong one it may adversely affect Oracle.

 

I would advise to only delete shared memory segments after very careful consideration.

madhu22
Occasional Visitor

Re: ipcs shared memory

Hi Patrick,

 

Thanks for the response.

 

 

without deleting shared memory ,how can I fine tune the oracle performance.

 

regards'

 

Madhu

Dennis Handly
Acclaimed Contributor

Re: ipcs shared memory

>is it possible to clear the shared memory from the above outputs?

82950 0x1550f7c4 --rw-r-----    oracle  oinstall    oracle  oinstall     15 1593843712

 

What do you think you'll be able to do if you remove the SGA?  You'll have to stop those 15 processes.

 

>without deleting shared memory, how can I fine tune the oracle performance.

 

Add lots more RAM?

Bill Hassell
Honored Contributor

Re: ipcs shared memory

Shared memory is something that a program requests and uses to exchange data between other processes. Oracle performance is significantly enhanced by increasing the size of SGA (which is shared memory). But if you are running out of memory, Oracle performance cannot be improved.

 

As Patrick mentioned, removing shared memory segments that are still being used will usually crash the processes that depend on these segments. Now if someone has not been properly shutting down processes that use shared memory (as in: kill -9) then shared memory will be a mess of used and unused segments. It would be nice if unused segments could be identified but the problem is that a segment can be created by one process and used by several others. The creator does not have to stay running for the segment to remain available. In fact, all processes that were using the segment could terminate and start again at a later time using the segment ID to reconnect to the sdhared memory area.

 

That's why it is dangerous to use ipcrm to remove segments without accurate information about the segments. Most programs never provide a way to identify segments that are active.

 

The only safe way to recover the memory area is to reboot, then make sure no one uses kill -9 against programs that use shared memory.

 

In general, Oracle (and most other database engines) will run much faster if the number of disk I/Os are reduced and this can be done by tuning the SGA and parameters that use the SGA. An Oracle performance specialist can look over your current setup and make recommendations. Note that trying to play with the OS to make Oracle run faster is like a slow car where you hope that adding air to the tires will make it go faster instead of getting a bigger motor.



Bill Hassell, sysadmin