[Openais] [Corosync] The corosync shared memory keeps increasing

Angus Salkeld asalkeld at redhat.com
Tue Aug 3 18:33:15 PDT 2010


On Tue, Aug 03, 2010 at 11:02:24AM -0600, hj lee wrote:
> Hi,
> 
> I tried the latest version corosync 1.2.7 rpms from clusterlabs. The problem
> is still there. Actually the latest version gets worse. In old 1.1.2
> version, the shared memory increases only when cib exachanges messages
> through corosync. In the 1.2.7 version, corosync shared memory keeps
> increasing even when the cluster is idle. Simply run the corosync and watch
> the memory in the top every a few minutes, the shared memory just keeps
> increasing. Isn't this a memory leak?

Hi hj

I'll take a look.

> 
> 1. Shared memory increases when the cluster is idle. I highly suspect it
> leak comes from circular mmap in logsys.c.

I don't think logsys can leak shared memory as it is mmap'ed at
startup (it could leak if it doesn't unmmap on shutdown).

It might be showing the amount that is actually used (not allocated).

I ran cpgbench and when it exited the shared mem always came back to
5040 (full logsys ringbuffer).

The other thing is that shared mem is not allocated in small amounts.
Both the IPC and logsys mmap() large chunks (logsys at startup, and IPC
per connection).

-Angus

> [root at silverthorne4 epel]# top -b -n1 | egrep "coro|cib|attrd"
> 16579 root      RT   0  207m 4200 1920 S  0.0  0.1   0:00.07 corosync
> 16587 hacluste  -8   0 69044 4536 2544 S  0.0  0.1   0:00.35 cib
> 16589 hacluste  -8   0 69808 2436 2024 S  0.0  0.1   0:00.00 attrd
> ---- after a few minutes later
> [root at silverthorne4 epel]# top -b -n1 | egrep "coro|cib|attrd"
> 16579 root      RT   0  207m 4212 1932 S  0.0  0.1   0:00.07 corosync
> 16587 hacluste  -8   0 69044 4536 2544 S  0.0  0.1   0:00.35 cib
> 16589 hacluste  -8   0 69808 2436 2024 S  0.0  0.1   0:00.00 attrd
> 
> 
> 2. Shared memory increases whenever pacemaker resource is started or
> stopped. In this case, cib's shared memory also increases. I highly suspect
> this leak comes from mmap in corosync ipc code.
> [root at silverthorne4 epel]# top -b -n1 | egrep "coro|cib|attrd"
> 16579 root      RT   0  207m 4316 2036 S  0.0  0.1   0:00.11 corosync
> 16587 hacluste  -8   0 69048 4596 2584 S  0.0  0.1   0:00.39 cib
> 16589 hacluste  -8   0 69808 2436 2024 S  0.0  0.1   0:00.00 attrd
> 
> [root at silverthorne4 epel]# crm resource stop faultymon-clone
> 
> [root at silverthorne4 epel]# top -b -n1 | egrep "coro|cib|attrd"
> 16579 root      RT   0  207m 4336 2056 S  0.0  0.1   0:00.13 corosync
> 16587 hacluste  -8   0 69068 4620 2596 S  0.0  0.1   0:00.41 cib
> 16589 hacluste  -8   0 69808 2436 2024 S  0.0  0.1   0:00.00 attrd
> 
> Thanks
> hj
> 
> -- 
> Peakpoint Service
> 
> Cluster Setup, Troubleshooting & Development
> kerdosa at gmail.com
> (303) 997-2823

> _______________________________________________
> Openais mailing list
> Openais at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/openais



More information about the Openais mailing list