[OpenSIPS-Users] Quest to find memory leak
john.nash778 at gmail.com
Mon Mar 6 03:57:19 EST 2017
Below is the info on my processes
Process:: ID=0 PID=17351 Type=attendant
Process:: ID=1 PID=17352 Type=MI FIFO
Process:: ID=2 PID=17353 Type=MI Datagram
Process:: ID=3 PID=17354 Type=time_keeper
Process:: ID=4 PID=17355 Type=timer
Process:: ID=5 PID=17356 Type=SIP receiver udp:22.214.171.124:9094
Process:: ID=6 PID=17357 Type=SIP receiver udp:126.96.36.199:5060
Process:: ID=7 PID=17358 Type=SIP receiver udp:192.168.45.5:5064
Process:: ID=8 PID=17359 Type=Timer handler
188.8.131.52 is public IP (I changed). The decrease in memory I see is for
Process:: ID=7 PID=17358 mainly. My call flow is as following
- New Invite hits the opensips on 184.108.40.206:9094
- Apart from message validity checks I query DB to check if its a valid
user (Using local cache also there)
- Create dialog, Topology_hiding functions are called along with some avp
- Using dispatcher ds_select_domain Call sent to udp:192.168.45.2:7060
(using force socket). This 192.168.45.2:7060 is actually freeswitch
- Call again comes back to opensips on udp:192.168.45.5:5064
- New dialog is created and topology_hiding is called
- Drouting function do_routing is called which tries one gateway and fails
Dump i need to create with memlog=4 memdump=1 right?
On Mon, Mar 6, 2017 at 2:05 PM, Răzvan Crainea <razvan at opensips.org> wrote:
> Hi, John!
> Transactions are stored in shared memory, not in the private one. So the
> possible leak you are facing its not related to transactions.
> During runtime, OpenSIPS might resize some internal structures, which may
> lead to increase memory usage. However, after a while, these allocations
> should stabilize .
> Can you post the output of the kill -SIGUSR1 on pastebin so we can take a
> look? Also, what type of process is the one you are seeing the leak into?
> You can find out using the 'opensipsctl ps' command.
> Best regards,
> Răzvan Crainea
> OpenSIPS Solutionswww.opensips-solutions.com
> On 03/06/2017 09:55 AM, John Nash wrote:
> I am using OpenSIPS (2.1.5 (x86_64/linux)) in production. I observed
> private memory is decreasing constantly for one process mainly and
> ultimately leading to memory errors and crash.
> To debug this issue I prepared a test server and compiled opensips as per
> I made only one single call (which was rejected by opensips as it was not
> authorized user) and I saw private free memory decreased. I was hoping
> since transaction is done ideally it should release memory and should show
> me same memory as startup but it did not. I verified this with many call
> attempts and i see free memory is always decreasing slowly.
> I used kill -SIGUSR1 <lowest pid> to create memory dump. But i am unable
> to make sense of it. It shows log like ...
> r 6 07:29:19 Server3021 opensips: Memory status (pkg):
> Mar 6 07:29:19 Server3021 opensips: qm_status (0x7f5b8ebba010):
> Mar 6 07:29:19 Server3021 opensips: heap size= 4194304
> Mar 6 07:29:19 Server3021 opensips: used= 346768,
> used+overhead=848792, free=3345512
> Mar 6 07:29:19 Server3021 opensips: max used (+overhead)= 931920
> Mar 6 07:29:19 Server3021 opensips: dumping all alloc'ed.
> Mar 6 07:29:19 Server3021 opensips: 0. N
> address=0x7f5b8ebef528 frag=0x7f5b8ebef4f8 size=40 used=1
> Mar 6 07:29:19 Server3021 opensips: alloc'd from
> script_cb.c: add_callback(60)
> Mar 6 07:29:19 Server3021 opensips: start
> check=f0f0f0f0f0f0f0f0, end check= c0c0c0c0c0c0c0c0, abcdefedabcdefed
> Mar 6 07:29:19 Server3021 opensips: 1. N
> I pasted only few lines in this mail. What should be my next step?...How
> can i really trace what is wrong in my script or any other memory leak?
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
> Users mailing list
> Users at lists.opensips.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users