[Home]

Summary:ASTERISK-24608: Asterisk consumes more memory (and CPU) gradually: memory leak.
Reporter:ibercom (ibercom)Labels:
Date Opened:2014-12-11 13:51:54.000-0600Date Closed:2015-02-21 11:03:07.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:General
Versions:11.14.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian WheezyAttachments:( 0) memallocations.zip
( 1) memallocations2.tar.gz
( 2) memsummary.zip
( 3) memsummary2.tar.gz
( 4) server.log
( 5) server2.log
Description:I have a Asterisk 11 server. No transcoding. PRI, SIP and IAX calls. SIP realtime config.

Asterisk consumes more CPU (and memory) gradually. This starts to happen when asterisk processed enough calls. And the CPU % no longer drops in idle times.

I think so that it is a bug but I don't know where.

How can i find the asterisk's cpu usage ? Which process/thread/code is the culprit ?

Asterisk 1.8 (same config and similar modules) consumes far less memory. And half of CPU. Is it normal ?
Comments:By: ibercom (ibercom) 2014-12-11 14:05:16.623-0600

memory show summary

By: ibercom (ibercom) 2014-12-11 14:10:39.323-0600

memory show allocations

By: ibercom (ibercom) 2014-12-11 14:18:34.647-0600

For 4 days:
core show uptime
core show calls
$ ps up asteriskpid
sip show peers


By: Rusty Newton (rnewton) 2014-12-16 15:15:06.932-0600

{quote}
And the CPU % no longer drops in idle times.
{quote}

Can you provide the "top -p <pid>" output and Asterisk CLI "core show threads" output when Asterisk is idle, and then at a point in the future after the CPU % no longer returns to what you would expect (again when idle).

Might as well get correlating "memory show allocations" and "memory show summary" for those two data points as well.

If possible, you might get more than two data points, just make sure there are no calls or channels running at the time.

By: ibercom (ibercom) 2014-12-19 13:14:58.597-0600

Perhaps the problem is MEMORY consumption and this affects CPU consumption.

The memory logs show increased cache (ast_frdup). And especially many alloc_event_ref, ast_event_dup and internal_ao2_link.

The server2.log file has info about calls processed and "ps up <pid>" output when Asterisk is idle (0 active calls). "core show threads" output is normal about 45 threads listed.


By: ibercom (ibercom) 2014-12-19 13:19:26.734-0600

Asterisk re-starts on [Dec 11 20:27:45]

By: Matt Jordan (mjordan) 2015-01-12 09:40:50.175-0600

While your memory logs show that memory is accumulating over time - particularly in {{chan_iax2}} - that isn't sufficient for someone to diagnose what the cause of the problem is. You'll need to provide instructions for reproducing the growth in memory. Please include the following:
* Your system configuration, including all channel {{conf}} files as well as dialplan.
* DEBUG logs showing the call traffic during the time that the memory growth is occurring. For the channel drivers involved, please include the necessary channel driver debugging, e.g., 'sip set debug on' if {{chan_sip}} is involved, etc.
* Preferably, an isolated call that demonstrates the growth in memory. That is, if you notice that after some specific IAX2 call the memory has increased after the call completed, then note that this particular channel/call caused the issue.

By: ibercom (ibercom) 2015-01-20 12:59:33.421-0600

The system handles ~10000 calls each day and it is very difficult find a problematic call.

[ASTERISK-24451] might be the cause for this bug.
Each day i have new allocations for file ASTOBJ2.c, event.c, frame.c and SCHED.c and it seems related to chan_iax2 too.


By: Rusty Newton (rnewton) 2015-01-30 13:45:09.749-0600

Without the information Matt requested, I don't know what else we can do here.

We could guess all day, but that won't help. :)

If you can't provide the requested information then we'll go ahead and close this out.

By: Matt Jordan (mjordan) 2015-02-21 11:02:54.478-0600

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines