Random Memory Allocation Failure in

Hello!
Good day!
Yesterday I updated DEBIAN 10 to the latest version, rebooted the server and began to receive these errors in the asterisk console:

[Jun 22 16:46:25] ERROR [4806] res_pjsip.c: Error 70007 ‘Not enough memory (PJ_ENOMEM)’ sending OPTIONS request to endpoint

[Jun 22 19:50:02] ERROR [2361] astmm.c: Memory Allocation Failure in function __ast_string_field_init at line 183 of stringfields.c
[Jun 22 19:50:02] ERROR [2361] astmm.c: Memory Allocation Failure in function aco_set_defaults at line 942 of config_options.c
[Jun 22 19:50:05] ERROR [2361] astmm.c: Memory Allocation Failure in function __ast_string_field_init at line 183 of stringfields.c
[Jun 22 19:50:15] ERROR [2361] astmm.c: Memory Allocation Failure in function format_cap_init at line 109 of format_cap.c
[Jun 22 19:51:19] ERROR [2362] astmm.c: Memory Allocation Failure in function __ast_string_field_init at line 183 of stringfields.c
[Jun 22 19:58:23] ERROR [2361] astmm.c: Memory Allocation Failure in function realtime_odbc at line 311 of res_config_odbc.c
[Jun 22 17:58:00] ERROR [23495] astmm.c: Memory Allocation Failure in function get_single_field_as_var_list at line 1485 of sorcery.c
[Jun 22 17:58:30] ERROR [21722] [C-00000045] astmm.c: Memory Allocation Failure in function ast_json_malloc at line 49 of json.c
[Jun 22 17:58:30] ERROR [21722] [C-00000045] json.c: Error building JSON from ‘{s: s, s: s, s: f}’: NULL object value.
[Jun 22 17:58:30] ERROR [21722] [C-00000045]: Got 21 backtrace records

0: / usr / sbin / asterisk (ast_json_vpack + 0xbf) [0x55f7a55372af]

1: / usr / sbin / asterisk (ast_json_pack + 0x9f) [0x55f7a55371e0]

2: /usr/lib/asterisk/modules/res_rtp_asterisk.so(+0x1ae1d) [0x7f712b114e1d]

3: /usr/lib/asterisk/modules/res_rtp_asterisk.so(+0x1b736) [0x7f712b115736]

4: /usr/lib/asterisk/modules/res_rtp_asterisk.so(+0x1eb29) [0x7f712b118b29]

5: / usr / sbin / asterisk (ast_rtp_instance_read + 0x57) [0x55f7a55846cf]

6: /usr/lib/asterisk/modules/res_pjsip_sdp_rtp.so(+0xb4f0) [0x7f712905c4f0]

7: /usr/lib/asterisk/modules/chan_pjsip.so(+0x9774) [0x7f71290b7774]

8: / usr / sbin / asterisk (+ 0xb9d0b) [0x55f7a54c9d0b]

9: / usr / sbin / asterisk (ast_read + 0x22) [0x55f7a54cbd36]

10: /usr/lib/asterisk/modules/app_dial.so(+0x74f0) [0x7f712b66e4f0]

11: /usr/lib/asterisk/modules/app_dial.so(+0xdc78) [0x7f712b674c78]

12: /usr/lib/asterisk/modules/app_dial.so(+0x1033c) [0x7f712b67733c]

13: / usr / sbin / asterisk (pbx_exec + 0x125) [0x55f7a5574379]

14: / usr / sbin / asterisk (+ 0x14f4bb) [0x55f7a555f4bb]

15: / usr / sbin / asterisk (ast_spawn_extension + 0x50) [0x55f7a556353e]

16: / usr / sbin / asterisk (+ 0x15425f) [0x55f7a556425f]

17: / usr / sbin / asterisk (+ 0x155ad1) [0x55f7a5565ad1]

18: / usr / sbin / asterisk (+ 0x1f017c) [0x55f7a560017c]

19: /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f7142a07fa3]

20: /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f71425de4cf]

sometimes they cause asterisk to crash:
[Jun 22 12:00:29] ERROR [17303] astmm.c: Memory Allocation Failure in function realtime_odbc at line 311 of res_config_odbc.c │ [Jun 22 12:03:21] ERROR [19683] astmm.c: Memory Allocation Failure in function aco_set_defaults at line 942 of config_options.c │ [Jun 22 12:03:21] ERROR [19685] astmm.c: Memory Allocation Failure in function aco_set_defaults at line 942 of config_options.c │ [Jun 22 12:06: 35] ERROR [17321] pjproject: except.c !!! FATAL: unhandled exception PJLIB / No memory! │ [Jun 22 12:06:37] Asterisk 16.10.0 built by root @ deb on a x86_64 running Linux on 2020-06-22 06:42:30 UTC

Jun 22 11:39:20] ERROR [11917] astmm.c: Memory Allocation Failure in function realtime_odbc at line 311 of res_config_odbc.c │ [Jun 22 11:39:22] ERROR [7994] astmm.c: Memory Allocation Failure in function tps_task_alloc at line 334 of taskprocessor.c │ [Jun 22 11:39:22] ERROR [7994] taskprocessor.c: failed to allocate task! │ [Jun 22 11:39:22] ERROR [7994] taskprocessor.c: t is NULL! [Jun 22 11:39:58] ERROR [7995] astmm.c: Memory Allocation Failure in function task_pushed_data_alloc at line 469 of threadpool.c │ [Jun 22 11:41:39] ERROR [8001] astmm.c: Memory Allocation failure in function realtime_odbc at line 311 of res_config_odbc.c │ [Jun 22 11:41:53] Asterisk 16.11.1 built by root @ deb on a x86_64 running Linux on 2020-06-22 06:33:03 UTC

I tested version 16.10 , 16.11 , 16.11.1
there is a lot of RAM on the server
total used free shared buff / cache available
Mem: 65744672 8192880 51494260 27752 6057532 56847960
Swap: 2060284 0 2060284

the limits for the process are large (the asterisk has PID = 720):
cat / proc / 720 / limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 2 2 bytes
Max resident set unlimited unlimited bytes
Max processes 256671 256671 processes
Max open files 1048576 1048576 files
Max locked memory unlimited unlimited bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 256671 256671 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us

I also installed the kernel 5.6 from the repositories of Debian 10, but the problem repeats on it.
What can be done?

I found a solution to the problem: the reason was that the asterisk was going to be in DEBUG mode and without the OPTIMIZE option, this was done to debug another problem.
After I removed debug mode and turned on optimization, everything worked fine.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.