High Memory Consumption

Hi guys. I’m running FreePBX Distro 10.13.66-13 32bits on an Athlon 64 X2 4000 with 2GB of RAM, of which 1860 MB are available to the OS due to onboard VGA. The PC is connected to a UPS with a serial cable using Network UPS tools, this is the only added package, everything else is stock FreePBX Distro.

The PC has 2 network cards, onboard card is used to connect to the Voice LAN and PCI add-on card is used to connect to SIP provider’s private network. Fail2Ban (default Distro configuration) along with IPTables is used for security.

There are 18 SIP extensions, 1 DAHDI extension, 1 SIP trunk and 1 DAHDI trunk. All SIP calls are g729 and all DAHDI calls are ulaw, transcoding is only used when mixing DAHDI with SIP, otherwise no transcoding is used. DAHDI services are provided by a Sangoma B600 PCI card.

We are not using MeetMe, conferences, queues or any other “complex” functionalities, just 1 IVR and 2 Time Conditions. We are also not recording any calls nor using VM.

Immediately after rebooting the PC, the total used memory is around 400MB, but after just a couple of days without a reboot, the memory usage go up as much as 1700 MB. At this time, the PC has an uptime of 12 days and 1660 MB are used. Is this high memory consumption a normal situation, or is it possible that there is some kind of memory leak? I have searched the forum (and Google too) but couldn’t find any similar issue that has been solved or any information that would help diagnose whether I’m experiencing a memory leak situation. Any help would be really helpful. Even though I never experienced any issues related to low memory, I’m afraid I might will if the memory usage keeps raising.

This is current memory usage as reported by top and sorted by MEM%

top - 14:35:28 up 12 days, 3:45, 1 user, load average: 0.09, 0.04, 0.01
Tasks: 130 total, 1 running, 129 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1905996k total, 1695032k used, 210964k free, 260168k buffers
Swap: 785404k total, 0k used, 785404k free, 874672k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22800 asterisk 20 0 128m 42m 7300 S 0.0 2.3 0:45.99 node
24304 asterisk 20 0 90636 38m 8376 S 0.0 2.1 0:02.51 httpd
24303 asterisk 20 0 90632 38m 8704 S 0.0 2.1 0:03.70 httpd
20938 asterisk 20 0 89616 38m 8696 S 0.0 2.1 0:03.48 httpd
20937 asterisk 20 0 89608 37m 8688 S 0.0 2.0 0:03.45 httpd
24299 asterisk 20 0 88592 36m 8372 S 0.0 2.0 0:02.14 httpd
24301 asterisk 20 0 88592 34m 5472 S 0.0 1.8 0:02.46 httpd
24297 asterisk 20 0 87560 33m 5288 S 0.0 1.8 0:02.30 httpd
22492 asterisk 20 0 83512 31m 11m S 0.0 1.7 67:26.94 asterisk
24302 asterisk 20 0 85520 31m 5272 S 0.0 1.7 0:01.28 httpd
20936 asterisk 20 0 76428 26m 8020 S 0.0 1.4 0:01.34 httpd
1993 mysql 20 0 137m 23m 5928 S 0.0 1.3 40:01.14 mysqld
24306 asterisk 20 0 71176 22m 7436 S 0.0 1.2 0:01.25 httpd
22777 asterisk 20 0 64960 21m 7820 S 0.3 1.2 30:53.61 presence.php
24305 asterisk 20 0 72208 20m 4944 S 0.0 1.1 0:01.42 httpd
22770 asterisk 20 0 82884 18m 5384 S 0.0 1.0 0:00.52 node
2097 root 20 0 58324 13m 7600 S 0.0 0.7 0:27.66 httpd
11262 root 20 0 156m 6828 2360 S 0.0 0.4 10:43.06 fail2ban-server
2120 prosody 20 0 13468 5580 920 S 0.0 0.3 2:04.19 lua
20456 root 20 0 11644 3636 2876 S 0.0 0.2 0:00.09 sshd
1178 root 20 0 38212 3620 1000 S 0.0 0.2 0:13.83 rsyslogd
1722 haldaemo 20 0 16916 3564 2920 S 0.0 0.2 0:05.28 hald
2093 postfix 20 0 12864 2684 2024 S 0.0 0.1 0:01.00 qmgr
2086 root 20 0 12628 2544 1908 S 0.0 0.1 0:03.41 master
18446 postfix 20 0 12704 2528 1912 S 0.0 0.1 0:00.00 pickup
1846 ntp 20 0 5608 1876 1432 S 0.0 0.1 0:01.74 ntpd
20458 root 20 0 5256 1708 1408 S 0.0 0.1 0:00.02 bash
1672 avahi 20 0 3220 1564 1336 S 0.0 0.1 0:03.19 avahi-daemon
1882 root 20 0 5120 1416 1224 S 0.0 0.1 0:00.02 mysqld_safe
22776 root 20 0 5168 1412 1080 S 0.0 0.1 0:00.00 su
1 root 20 0 2900 1384 1168 S 0.0 0.1 0:01.04 init
11264 root 20 0 3584 1296 1068 S 0.0 0.1 0:17.54 gam_server
2107 root 20 0 6576 1240 640 S 0.0 0.1 0:24.21 crond
1723 root 20 0 4052 1196 1036 S 0.0 0.1 0:00.00 hald-runner
21365 root 20 0 2700 1136 872 R 0.0 0.1 0:00.04 top
1752 root 20 0 4124 1128 988 S 0.0 0.1 0:00.00 hald-addon-inpu
1812 root 20 0 8628 1044 532 S 0.0 0.1 0:00.00 sshd
1767 haldaemo 20 0 3708 1024 900 S 0.0 0.1 0:00.00 hald-addon-acpi
22916 root 20 0 3532 1020 836 S 0.0 0.1 0:00.00 incrond
1785 root 20 0 6216 1004 664 S 0.0 0.1 0:00.00 upsmon
1786 nut 20 0 6216 932 588 S 0.0 0.0 0:27.58 upsmon
1821 root 20 0 2896 928 740 S 0.0 0.0 0:00.00 xinetd
1781 nut 20 0 6352 924 540 S 0.0 0.0 0:38.73 upsd
1158 root 16 -4 13932 880 616 S 0.0 0.0 0:20.39 auditd

If any additional info is needed, please let me know and I will post it here.

Thanks, Ariel.

pretty normal. don’t worry about it

1 Like

Thanks for your reply Bob. Do you think that this could escalate into an issue due to low memory? Should I add additional RAM to the server, or given that the processed calls have been around the same amount since this PBX has been installed (more than 3 years ago) can I assume I should have no issues as long as the amount of calls stays the same? I noticed that sometimes some memory is freed randomly, as if some “garbage collection” would be happening.

I think you are not reading your .e.ory right as Linux will cache everything it can. Do a free -m from client and you true memory usage is after you back out cache

you will be fine. we run 50+ extensions with an average of concurrent calls plus iSymphony on a single core Xeon with 2gb memory and 25gb disk.