High RAM usage for asterisk

We seem to be having a possible memory leak in asterisk and are having some issues locating the underlying cause. We can see from the htop that asterisk is using more memory than it should.


Here are the results from a slabtop:

The noticeable signs of the issue are a reoccurring message to the CLI:

[2017-10-02 19:10:49] WARNING[79640][C-000020f3]: taskprocessor.c:888 taskprocessor_push: The ‘subm:manager_topic-00000007’ task processor queue reached 3000 scheduled tasks again.

We are running asterisk version 13.17.0 with FreePBX 12.7.3-1707-2.sng7 and all our current extensions are PJSIP (330 extensions) and we have 300 queues for various products/states. Please let me know if I can provide anything else that would be helpful.

I am seeing very similar results in htop here as well, we only have a couple queues, but about 550 extensions. At this time I am showing 13.6G virtual, and 383M resident.

I thought Asterisk wasn’t threaded, so why so many sub-processes for asterisk??

I am seeing lots of cache but your memory usage isn’t super high. We have 1000 extensions and tons of call flow and this is ours. Its slowly creeped up to this memory use as we add more to it:

It never seemed like a spike and when we do restart asterisk we reduce memory usage. The leak is pretty slow. Just restart asterisk once in a while.

Restarting asterisk will only get the Virt back to normal until normal until more than 3 extensions start dialing. Then the Virt goes right back to 17.1GB

You have no virtual memory being used (Its swap in linux). You have asterisk caching what looks like your entire dialplan and thats normal. You want that in a server.