I have Asterisk 13.11 installed in a debian 8 machine. The memory consumption of asterisk rises with time until it is killed by the system with an Out of memory error, or i restart the service.
I had the same problem with 13.5. I do a lot of outbound dialing using AMI Originate, and i pass some variables with the originate action. And i use chan_sip. I disabled most of the modules that i don’t use.
Here is the output of memory show summary. I see here that a lot is allocated to stasis_channels.c. Is it related to ARI? because i don’t use it.
Thank you
memory show summary
386741 bytes in 513 allocations in file /usr/src/asterisk-13.11.0/include/asterisk/strings.h
376848 bytes in 1355 allocations in file /usr/src/asterisk-13.11.0/include/asterisk/threadstorage.h
1616 bytes in 7 allocations in file acl.c
736 bytes in 1 allocations in file app_bridgewait.c
992 bytes in 1 allocations in file app_confbridge.c
3231 bytes in 18 allocations in file app_dial.c
1520 bytes in 38 allocations in file app_macro.c
161650 bytes in 160 allocations in file app_mixmonitor.c
392552 bytes in 1037 allocations in file app_queue.c
3248 bytes in 58 allocations in file app_stack.c
13642 bytes in 587 allocations in file asterisk.c
6354576 bytes in 79429 allocations in file astobj2.c
2400 bytes in 20 allocations in file audiohook.c
320 bytes in 20 allocations in file autochan.c
96 bytes in 2 allocations in file autoservice.c
196912 bytes in 610 allocations in file bridge.c
7936 bytes in 160 allocations in file bridge_basic.c
23040 bytes in 64 allocations in file bridge_channel.c
1016 bytes in 1 allocations in file bucket.c
896 bytes in 6 allocations in file ccss.c
211994 bytes in 829 allocations in file cdr.c
6968 bytes in 7 allocations in file cel.c
1506812 bytes in 1716 allocations in file chan_sip.c
469203 bytes in 1679 allocations in file channel.c
136786 bytes in 381 allocations in file channel_internal_api.c
8839 bytes in 452 allocations in file cli.c
6176 bytes in 44 allocations in file codec.c
155272 bytes in 73 allocations in file confbridge/conf_config_parser.c
87537 bytes in 632 allocations in file config.c
40568 bytes in 191 allocations in file config_options.c
160 bytes in 1 allocations in file core_local.c
17978 bytes in 156 allocations in file core_unreal.c
16884 bytes in 27 allocations in file data.c
306 bytes in 22 allocations in file datastore.c
3761627 bytes in 45498 allocations in file devicestate.c
4906 bytes in 55 allocations in file dial.c
2880 bytes in 2 allocations in file dsp.c
471728 bytes in 2183 allocations in file endpoints.c
3072 bytes in 128 allocations in file features.c
105235 bytes in 817 allocations in file features_config.c
675406 bytes in 72 allocations in file file.c
9554 bytes in 137 allocations in file format.c
1016 bytes in 1 allocations in file format_cache.c
2057912 bytes in 19016 allocations in file format_cap.c
230879 bytes ( 230879 cache) in 601 allocations in file frame.c
48 bytes in 2 allocations in file func_curl.c
736 bytes in 1 allocations in file func_dialgroup.c
14245 bytes in 124 allocations in file func_lock.c
133653 bytes in 411 allocations in file func_odbc.c
12696 bytes in 41 allocations in file hashtab.c
78554 bytes in 548 allocations in file http.c
66444 bytes in 1191 allocations in file indications.c
8228 bytes in 4 allocations in file io.c
694852603 bytes in 5841291 allocations in file json.c
2296 bytes in 1 allocations in file libasteriskssl.c
24467 bytes in 206 allocations in file loader.c
10398 bytes in 62 allocations in file logger.c
56076693 bytes in 97726 allocations in file manager.c
1208 bytes in 99 allocations in file max_forwards.c
3567568 bytes in 20437 allocations in file media_index.c
96 bytes in 2 allocations in file message.c
832 bytes in 2 allocations in file named_acl.c
1760 bytes in 1 allocations in file named_locks.c
301938 bytes in 3159 allocations in file pbx.c
335879 bytes in 427 allocations in file pbx_app.c
30066 bytes in 859 allocations in file pbx_config.c
348432 bytes in 349 allocations in file pbx_functions.c
725 bytes in 29 allocations in file pbx_hangup_handler.c
52155 bytes in 1234 allocations in file pbx_variables.c
56 bytes in 1 allocations in file presencestate.c
448 bytes in 1 allocations in file res_calendar.c
2669 bytes in 6 allocations in file res_clialiases.c
1118 bytes in 23 allocations in file res_config_sqlite.c
256 bytes in 1 allocations in file res_config_sqlite3.c
320 bytes in 2 allocations in file res_fax.c
36263 bytes in 100 allocations in file res_http_websocket.c
27225 bytes in 49 allocations in file res_musiconhold.c
752 bytes in 5 allocations in file res_odbc.c
1801455 bytes in 39373 allocations in file res_rtp_asterisk.c
619632 bytes in 216 allocations in file res_srtp.c
13192 bytes in 97 allocations in file res_timing_timerfd.c
11903866 bytes in 92944 allocations in file rtp_engine.c
270232 bytes in 1035 allocations in file sched.c
288 bytes in 18 allocations in file sdp_srtp.c
3143 bytes in 52 allocations in file sip/route.c
32528 bytes in 2 allocations in file smoother.c
7981 bytes in 34 allocations in file sorcery.c
4495009 bytes in 48335 allocations in file stasis.c
14101952 bytes in 70908 allocations in file stasis_bridges.c
16985391 bytes in 302065 allocations in file stasis_cache.c
46680 bytes in 389 allocations in file stasis_cache_pattern.c
1399673157 bytes in 1589412 allocations in file stasis_channels.c
22256 bytes in 214 allocations in file stasis_endpoints.c
185585653 bytes in 1364699 allocations in file stasis_message.c
59688 bytes in 536 allocations in file stasis_message_router.c
37104 bytes in 2 allocations in file stdtime/localtime.c
56542320 bytes in 332585 allocations in file stringfields.c
4981983 bytes in 40242 allocations in file strings.c
43394553 bytes in 1354311 allocations in file taskprocessor.c
21106 bytes in 130 allocations in file tcptls.c
27104 bytes in 288 allocations in file threadpool.c
1712 bytes in 100 allocations in file timing.c
1754032 bytes in 148 allocations in file translate.c
208 bytes in 2 allocations in file udptl.c
15698 bytes in 207 allocations in file utils.c
1029575 bytes in 5492 allocations in file xmldoc.c
2517337991 bytes allocated (230879 in caches) in 11371037 selected allocations
2517337991 bytes in all allocations
544312 bytes in deferred free large allocations
45892 bytes in deferred free small allocations
590204 bytes in deferred free allocations
2517928195 bytes in all allocations and deferred free allocations
So, yesterday at this time, asterisk was taking 51% of memory, and after two hours it would reach 90%, and eventually be killed if i don’t restart it.
What i did was disabling logging to a file, and reduced the logs for console to error only, and it seems that solved the problem, since asterisk is consuming now 3%, compared to 50% yesterday in the same time.
I don’t understund what is the relationship between logging and memory? Isn’t there another way to reduce memory consumption while keeping logs in a file? The logs are rotated by the way.
The memory consumption started to grow again, and at this rate, the memory will be saturated in a few hours. So that means that disabling the logs wasn’t effective, but i have no idea why the memory usage didn’t start growing until the aternoon.
I have 12G of ram, so it’s not a question of not having enough memory
No, i use sip.conf for sip peers, and don’t use voicemail. I mainly do outbound calls, and just a few inbound calls that go to a queue. And i also use odbc extensively.
I just installed 13.11.2, i’ll see tomorrow if there is any improvment.
OK, I think you have a different issue than @mkozusnik.
The output from ‘core show taskprocessors’ will at least tell us if the internal queues are backing up.
If this is related to AMI? because i do a lot of outbound calls using AMI Originate, sometimes 10-20 per second, and i also send some variables in the Originate action to use in the dialplan
It is indeed related to AMI. For each call connected, a web page is opened and there is a connection to manager via http. I log in and then execute an action. This is done for each call. The problem here is that i wasn’t logging off. This didn’t cause any problem in previous versions of Asterisk, may be the connection was timing out or something.
Anyway, now i just send a logoff action for each connection i open, and it seems that the problem is solved.
Hi I’m new to the support forum and before to open a new thread, i try to continue this with a problem which seems related,I hope it is correct.
I use Asterisk 13.17.0 to manage calls and audio routing between 50-60 SIP users, the calls are placed and routed by
an application conneted wit AMI interface using Originate Message and variable setting; the application do only
one connection to asterisk and remains connected for all his life.
Each SIP user send register every 30 sec (set in sip.conf).
For 6 days everything is ok, then the CPU consumption pass from 20% to 45%, and the messages file show the follow message :