Asterisk Realtime Constant Virtual Memory Increase

Hi,

I’m currently running two Asterisk (realtime) servers in a DUNDi arrangement. The DUNDi trunks are connected via IAX. Each server has approx 20 devices registered to it, cross server dialling is accomplished via the dialplan so everyone can reach an intended destination, be it an agent or the outside world. These servers use AGI scripts to perform some tasks and handle call flow.

It’s a pretty standard setup, and it’s running quite nicely barring one area - Virtual memory usage. It grows up to around 200MB a day, and eventually causes Asterisk top stop working properly when it hits the 1.5GB mark, calls stop being distributed to the handsets. To get around this, I have put nightly graceful restarts in place but this is certainly not ideal.

Does anyone have a heads up at any common issues that would cause Asterisk to eat up virtual memory in this way? Thanks.

There will be no common issues that cause this as if they were common they would have resulted in the underlying bug being fixed.

Are you using the latest minor version? If so, of what major version?

I’m using 1.8.27.0 with malloc debug enabled. I’ve searched through as much as I understand so far to try and isolate where this accumulation is coming from. Nothing stands out using ‘memory show…’, after performing a variety of tests, even at a Linux level using vmstat monitoring Asterisk that way.

I’ve been through all of the AGI scripts used ensuring recordsets are closed and variables unset with clean exits. Anything I can think of to stop the virtual and resident memory sizes from increasing.

Right now node1 (after a 4:30 am graceful restart) is sat at 161 VIRT 122 RES, and node2 (3am graceful restart) is sitting at 167 VIRT and 129 RES.

These servers are in action 24/7 handling calls, volume can hit as high as 12,000 (approx 1 minute) calls in a day. Staggered graceful restarts are not an elegant solution to this problem, so any help or advice will be gratefully received.