FOOD FOR THOUGHT App memory keeps climbing - normal?

bobkoure

Member
Joined
May 22, 2013
Messages
173
Reaction score
20
I'm running incrediblepi (ras pi) and noticed that app memory was over 80%. Up to now, it's been in the 12-15% range. I'd recently enabled DISA, so, to see if that was it, I disabled it and restarted asterisk.
Memory usage went back to 12%, has climbed to 45% in about a day. So not DISA.

Yes, the memory use was asterisk. When usage was 80+ top showed asterisk using 74, plus two other 'asterisk' processes using about 6% each.

So, is this 'normal'? Feels like a memory leak to me, but slow enough that putting
Code:
# restart asterisk every day at 4:00 AM because paranoia
* 4 * * * root /usr/sbin/asterisk -r -x "core restart now" >/dev/null 2>&1
in crontab had ought to deal with it - but do I need to?

Thanks!
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,534
Reaction score
727
I suspect not. A memory leak of that magnitude would be something for the general Asterisk community to complain loudly about, and they're not.

What do you get with free -m at the console?
 

bobkoure

Member
Joined
May 22, 2013
Messages
173
Reaction score
20
Currently showing 67%, asterisk uptime 2days
Code:
            total      used      free    shared    buffers    cached
Mem:          438        413        24          0        30        90
-/+ buffers/cache:
             292        146
Swap:          875        41        834

It's a RasPi. Beyond the standard incrediblepi I installed postfix, set it up to forward through gmail smtp. System is very lightly used (maybe 10 calls/day), two obihai adapters, 3 trunks, 1 IAX2, 2 SIP plus a GV XMPP/gtalk "trunk".
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Old News: Linux caches data in RAM until it runs out. Over time available RAM will always diminish on Linux-based servers. When the OS needs RAM for something else, it clears the cache.
 

bobkoure

Member
Joined
May 22, 2013
Messages
173
Reaction score
20
I'd thought that that was the case (I know how Android mem allocation works and figured linux was close or the same).
However, the "App Memory" bar on the FreePBX status page goes yellow at around 70% and red at 80%. When I see red on a status page like this, I assume something's going/gone wrong.

So, really normal? Other folks see the red and figure "meh... old news"?

Good to know.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Or reboot the RasPi every night. That's what we typically do to clean out problems before they cause... problems. :aureola:
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,534
Reaction score
727
I don't have a RasPi in my possession to give an authoritative answer. But given what we know about Linux memory management I suggest letting it go until it really is a problem. Why add hacks when they might not be needed. If the red thingy on the dashboard bothers you, you can edit the dashboard module and comment that out.
 

bobkoure

Member
Joined
May 22, 2013
Messages
173
Reaction score
20
It's not that the red thingie on the dashboard bothers me so much as whoever built that module, and whoever else decided that it should be on the dashboard by default probably had some kind of reason for it to both be there front-and-center, and for it to turn red at 80%. If growing to 100% is normal (as it is on Android, which is pretty much a kind of Linux) then why in the [expletive here] would they go to the trouble to alert about a normal process.
Then, there are lots of other installations out there. The module is on there, too, but a google search brings up very little chatter about it going red. So, in all likelihood, it's just my installation that's doing this.
All of that together bother me somewhat. I do want the phone to ring when someone calls me, after all.
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,534
Reaction score
727
You are probably right. But sometimes the reason is "hey we can put this here to fill this space." I have seen some applications where there is a clock in the corner. Useful, right? Of course not. There is already another clock on the screen, in the same place it is every day and where people have learned to look for the time. Ah, but this application's clock is special -- it shows the server time. You would think so, and you'd be wrong. :)
 

bobkoure

Member
Joined
May 22, 2013
Messages
173
Reaction score
20
Did you consider filing a bug/feature at issues.freepbx.org?

No point in filing an issue if it's normal behavior, or (IMO more likely) something I've misconfigured. But maybe it's close enough to "actually an issue" that I should do that.

it shows the server time
Sometimes it is the server time. I recently had a client's document management system fail because the underlying storage system (diskstations) had not been set to sync with a time server (seriously my bad) and once the time drifts far enough away from a windows domain master clock SMB stops working. Lucky for me I was RDPed into that server and, when I brought up the main diskstation page it showed it's own time. Knew what was wrong semi-immediately. Also slapped myself for the original screw-up.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
ntp is running on all Incredible PBX servers. We also run ntpdate for good measure whenever you log into a CuBox. We plan to add that to the other builds as well... some day. o_O
 

bobkoure

Member
Joined
May 22, 2013
Messages
173
Reaction score
20
ntp is running on...
Sorry Ward, I wasn't talking about incrediblepi but just commenting on why it might be good to have server time displayed.
Time to go see if I remembered to set the raspi ntp client to sync to my firewall.
 

Members online

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top