We have a problem with bad sound quality on high LA and size memory.
Using Asterisk 16 on 20 ubuntu like IVR, on 50 simultaneously calls, inbound and outbound we saw that after start it used ony 64Mb memory. But after 30-40 minutes it increase to 600-800Mb, 1M LA jumpt to 4-6 and sound of playing wav becomes metalic or distorted. It was resolved by script witch watches size of using memory and restart asterisk after memory size reached to 600Mb. At Asterisk v11.9.0 on 14 ubuntu it was every one - two hour.
After compilation asterisk with MALLOC_DEBUG Compiler Flag we recognized that almoust all memory asterisk allocate to manager.c but it increase to 460Mb only fist 30 minutes and then this value does not change, wherein LA increase up to 3-5. Based on ps utility data asterisk uses 700-800M. After stopping processing calls on 30 minutes, allocated to manager.c memory getting free, but used by asterisk memory in system remains unchanged.
Dialplan not very big, about 1500 lines, one hundred extensions. All logic located in php script witch called through AGI for every call. Outbound calls generate through ami and dialing on local channel. Also we use local asterisk db, local redis, and remote mysql databases.
Is the asterisk had to take such size of memory and LA for normal work? What is the reason of bad sound quality? Is it ami or agi or local channel? Any ideas or suggestions?