[asterisk-users] memory leak with static users

Gianpietro Germi g.germi at selta.it
Wed Nov 4 09:12:06 CST 2009


Hi,
we're using Asterisk 1.6.1.1.

We've got a memory leak with unconnected static users.

Our template for static users in users.conf is:
[static](!)
hassip=yes
hasiax=no
type=friend

[100](static)
context=periferico
host=192.168.0.1
port=5060
username=100
[101](static)
context=periferico
host=192.168.0.2
port=5060
username=101
......

This template generates polling with SIP OPTIONS messages to static
users.
We don't generate call then these messages are the only object created
more than once (i think..).
If users aren't connected we have a memory leak: the memory used by
Asterisk grow up and generate (after a time that depends from the number
of static users) an OOM and his consequent kill.

Using refcounter debug (uncomment REF_DEBUG macro in chan_sip.c), we
noticed only peer objects (builded by build_peer) have "Refcount not
zero".
Reading /tmp/refs, we noticed destructor is called for all channels
created (with sip_alloc) for to send SIP OPTIONS message.
This channels appear into refcounter debug when message is sent, but not
when timout expires and they are destroyed with **call destructor**.

Using our users.conf, the same thing happens with version 1.6.1.6, but not with 1.4.22.

Do you have any suggestions?

Thanks a lot.






More information about the asterisk-users mailing list