[asterisk-bugs] [JIRA] (ASTERISK-24916) Increasing memory usage when multiple reinvite during call
Christophe Osuna (JIRA)
noreply at issues.asterisk.org
Fri Mar 27 07:01:34 CDT 2015
[ https://issues.asterisk.org/jira/browse/ASTERISK-24916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christophe Osuna updated ASTERISK-24916:
----------------------------------------
Attachment: mem_atexit.log
rtp_engine2.log
rtp_engine1.log
rtp_engine0.log
mem2.log
mem1.log
mem0.log
asterisk.log
= Attachments =
Perl script to reproduce the issue:
* reinvite_loop.pl
Output of 'memory show summary'
* mem0.log: initial value
* mem1.log: during the re-invite loop
* mem2.log: later during the loop
I experienced that monitoring the output in real time shows better the increase. Interesting part from the diff between mem1.log and mem2.log:
- 855960 bytes in 35665 allocations in file astobj2.c
+ 903792 bytes in 37658 allocations in file astobj2.c
- 833512 bytes in 2234 allocations in file rtp_engine.c
+ 1566184 bytes in 4223 allocations in file rtp_engine.c
(but there are other differences that you may find more relevant)
Output of 'memory show allocations rtp_engine.c':
* rtp_engine0.log: initial value
* rtp_engine1.log: during the re-INVITE loop
* rtp_engine2.log: later during the loop
Actually that last log is only interesting to see the allocations increasing during the re-INVITE loop:
+ 364 bytes allocated by ast_rtp_codecs_payloads_copy() line 511 of rtp_engine.c
(repeated 2,000 times)
Memory usage at exit:
* mem_atexit.log: memory usage by file after shutting down process with 'core stop gracefully'
Asterisk log:
* asterisk.log: console output from 'asterisk -f -d -vvvv'
> Increasing memory usage when multiple reinvite during call
> ----------------------------------------------------------
>
> Key: ASTERISK-24916
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-24916
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Channels/chan_sip/General
> Affects Versions: 11.16.0
> Reporter: Christophe Osuna
> Assignee: Christophe Osuna
> Attachments: asterisk.log, mem0.log, mem1.log, mem2.log, mem_atexit.log, reinvite_loop.pl, rtp_engine0.log, rtp_engine1.log, rtp_engine2.log
>
>
> We have a setup with an Asterisk server 11.16.0 and an equipment sending periodically SIP INVITE requests during the same call. When monitoring memory usage, we noticed that RSS memory of the Asterisk process keeps on increasing. It's not a huge amount, but it's non-zero, so at some point this will trigger the OOM reaper and Asterisk process will be killed.
> The bug will happen in the following conditions:
> * in sip.conf ignoresdpversion is set and UA sends periodically SIP re-INVITE;
> * ignoredspversion is not set, and UA sends periodically SIP re-INVITE with a SDP session information with an increasing session version.
> I am attaching to the issue a Perl script to reproduce the issue.
> We used the DONT_OPTIMZE and MALLOC_DEBUG options to track down the issue. When monitoring the output of the 'memory show summary' command we can see that allocation increases for the file rtp_engine.c. Then, the output of 'memory show allocations rtp_engine.c' shows allocations in function rtp_engine.c:ast_rtp_codecs_payloads_copy(). So, my understanding of the issue is that whenever a SIP INVITE is received, the function chan_sip.c:process_sdp() is called. If the subsequent call to process_sdp_o() indicates that the session has been modified, the code will allocate new resources in ast_rtp_codecs_payloads_copy(), but will not necessarily free previously used resources.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list