possible memory Leak??

rpotthoff
Posts: 146
Member Since:
2006-12-19

I have a Dell system that I installed 2.4 on and have had up and running for a week now(rebooted once) I have noticed on the system Status page that the memory usage is at 96%, I have only two ext. on the system right now and nothing else running that i can see.
Anything I should check for? or is there a better way to see what is using the memory up?

Thanks



dickson
Posts: 1831
Member Since:
2006-06-02
This is normal behavior of

This is normal behavior of linux. Not to be confused with Windows eating up all the memory.



mustardman
Posts: 1289
Member Since:
2006-06-18
Yawn,Yet another "help, my

Yawn,

Yet another "help, my memory usage shows red so there must be something wrong" thread. It must have been at least a week since the last one.

In my expert opinon you should send your Dell computer back. There is a problem with it!
{/sarcasm off}



KodaK
Posts: 1885
Member Since:
2006-06-14
I added this to the Wiki

I added this to the Wiki FAQ.

To be fair, red is generally the "something is wrong" color, so it's not surprising that people who don't know would be concerned. Some logic should be added to that page that takes buffer memory into account.

--

WARNING: I no longer actively participate in these forums. My thoughts on trixbox in a nutshell: http://www.youtube.com/watch?v=q4xBMkWu1pE Use AsteriskNOW instead.



mustardman
Posts: 1289
Member Since:
2006-06-18
But nothing has been done in

But nothing has been done in Trixbox and nobody seems interested in changing anything so.............the beat goes on.



jahyde
Posts: 2002
Member Since:
2006-06-02
i believe all the status

i believe all the status pages do that, so we can blame them all ;)

--

--my PBX is run on 2 V8's



TDF
Posts: 483
Member Since:
2006-12-19
FreePBX says everythings

FreePBX says everythings fine, Trixbox says 'panic'.

The three wise monkeys hear/see/speak nothing.



rpotthoff
Posts: 146
Member Since:
2006-12-19
Ok then

If there is nothing wrong then, WHY do I not have this problem with my OLDER trixbox (1.2.3 and 2.2.x) systems?
I have never seen this before, so there has to be something wrong. what I do not know because there is nothing I can check to see what is using all the memory( or is there?)



TDF
Posts: 483
Member Since:
2006-12-19
From a command line type

From a command line type 'top' without the quotes, but seriously just ignore it.

Heres a good read, funny in places and downright sad in others

http://www.trixbox.org/forums/trixbox-forums/help/memory-usage-cl...



rpotthoff
Posts: 146
Member Since:
2006-12-19
I ran top

I ran top and it is showing I have:

1033624K Memory Total
967216K Used

So now what? there is something using the memory up, but it does not show what it is.
I see mysql using 2.1 to 2.4% of the memory, but that is not enough to be the problem.

TDF Thanks for the help!!!



kspare
Posts: 673
Member Since:
2007-02-16
yum install

yum install webmin
http://serverip:10000
login with your root account
system -> running processes -> memory

From here you can see alot of whats going on with your machine.



KodaK
Posts: 1885
Member Since:
2006-06-14
Post the whole header.

Post the whole header. Also, post the output of "free -m"

What you've posted there doesn't tell us how the memory is used, as used encompasses memory used by programs, and memory used by buffers and cache.

As others have been saying, though, most of the time this issue is brought up (and it's brought up a lot) it has been someone misunderstanding how RAM is used in Linux. It is not unusual for Linux to have little or no "free" memory, as unused memory gets used as a cache.

--

WARNING: I no longer actively participate in these forums. My thoughts on trixbox in a nutshell: http://www.youtube.com/watch?v=q4xBMkWu1pE Use AsteriskNOW instead.



rpotthoff
Posts: 146
Member Since:
2006-12-19
This is what I see in Webmin

2296 mysql 139044 kB /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/li ...
2470 root 56824 kB /usr/local/fonality/hud/hudlite-server
2585 asterisk 36392 kB /usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c
2459 asterisk 35320 kB /usr/sbin/httpd
2461 asterisk 35280 kB /usr/sbin/httpd
2462 asterisk 35280 kB /usr/sbin/httpd
2456 asterisk 35088 kB /usr/sbin/httpd
2457 asterisk 35064 kB /usr/sbin/httpd
2458 asterisk 35064 kB /usr/sbin/httpd
2460 asterisk 34748 kB /usr/sbin/httpd
2487 root 33064 kB /usr/bin/python /usr/sbin/yum-updatesd
2455 asterisk 32688 kB /usr/sbin/httpd
2396 root 26668 kB /usr/sbin/httpd
13255 root 15244 kB /usr/libexec/webmin/proc/index_size.cgi
2347 ircd 15028 kB ircd
9518 asterisk 12228 kB /usr/bin/perl -w /var/www/html/panel/op_server.pl
1854 root 12060 kB auditd
2707 root 11008 kB /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
1856 root 10072 kB python /sbin/audispd
2073 root 9352 kB automount
13143 root 9152 kB sshd: root@pts/0
2371 root 8964 kB sendmail: accepting connections
2379 smmsp 8008 kB sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
2119 root 6144 kB /usr/sbin/sshd
1997 root 5396 kB rpc.idmapd
2502 haldaemon 5296 kB hald
2411 root 5244 kB crond
2193 root 5056 kB /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
2576 root 4496 kB /bin/bash /usr/sbin/safe_asterisk -U asterisk -G asterisk
2660 asterisk 4496 kB -bash -c cd /var/www/html/panel && /var/www/html/panel/safe_opserver &
2260 root 4492 kB /bin/sh /usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --pid-file=/var/run/mys ...
13145 root 4492 kB -bash
2661 asterisk 4448 kB sh /var/www/html/panel/safe_opserver
2176 ntp 4316 kB ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
2503 root 3112 kB hald-runner
2024 dbus 2720 kB dbus-daemon --system
2142 root 2684 kB xinetd -stayalive -pidfile /var/run/xinetd.pid
372 root 2228 kB /sbin/udevd -d
2440 root 2220 kB /usr/sbin/atd
1 root 2040 kB init [3]
2700 root 1964 kB /usr/sbin/smartd -q never
2517 root 1928 kB hald-addon-storage: polling /dev/scd0
1952 root 1800 kB rpc.statd
1927 rpc 1788 kB portmap
1886 root 1704 kB syslogd -m 0
1889 root 1652 kB klogd -x
2718 root 1640 kB /sbin/mingetty tty5
2719 root 1640 kB /sbin/mingetty tty6
2710 root 1636 kB /sbin/mingetty tty1
2711 root 1636 kB /sbin/mingetty tty2
2712 root 1636 kB /sbin/mingetty tty3
2717 root 1636 kB /sbin/mingetty tty4
2 root 0 kB [migration/0]
3 root 0 kB [ksoftirqd/0]
4 root 0 kB [watchdog/0]
5 root 0 kB [migration/1]
6 root 0 kB [ksoftirqd/1]
7 root 0 kB [watchdog/1]
8 root 0 kB [events/0]
9 root 0 kB [events/1]
10 root 0 kB [khelper]
11 root 0 kB [kthread]
15 root 0 kB [kblockd/0]
16 root 0 kB [kblockd/1]
17 root 0 kB [cqueue/0]
18 root 0 kB [cqueue/1]
21 root 0 kB [khubd]
23 root 0 kB [kseriod]
113 root 0 kB [pdflush]
114 root 0 kB [pdflush]
115 root 0 kB [kswapd0]
116 root 0 kB [aio/0]
117 root 0 kB [aio/1]
271 root 0 kB [kpsmoused]
301 root 0 kB [ata/0]
302 root 0 kB [ata/1]
303 root 0 kB [ata_aux]
307 root 0 kB [scsi_eh_0]
308 root 0 kB [scsi_eh_1]
309 root 0 kB [scsi_eh_2]
310 root 0 kB [scsi_eh_3]
311 root 0 kB [kjournald]
338 root 0 kB [kauditd]
1174 root 0 kB [kmpathd/0]
1175 root 0 kB [kmpathd/1]
1205 root 0 kB [kjournald]



rpotthoff
Posts: 146
Member Since:
2006-12-19
[trixbox1.localdomain ~]#

[trixbox1.localdomain ~]# free -m
total used free shared buffers cached
Mem: 1009 946 63 0 149 572
-/+ buffers/cache: 224 785
Swap: 760 0 760

Webmin Header
Real memory: 1009.40 MB total / 780.41 MB free Swap space: 760.88 MB total / 760.88 MB free

Sorry for this just trying to understand what is going on here, ( I am a type A and just need to know)

Thanks



KodaK
Posts: 1885
Member Since:
2006-06-14
I meant post the whole

I meant post the whole header of top. For example:

top - 09:46:20 up 3 days, 18:34,  2 users,  load average: 0.29, 0.45, 0.44
Tasks:  92 total,   2 running,  90 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3% us,  0.0% sy,  0.0% ni, 99.7% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:    515520k total,   392596k used,   122924k free,     3712k buffers
Swap:  1052248k total,   324448k used,   727800k free,    42208k cached

Important bit I'd like to see is the buffers and cache over to the right.

Man it would be nice if the code tags worked.

--

WARNING: I no longer actively participate in these forums. My thoughts on trixbox in a nutshell: http://www.youtube.com/watch?v=q4xBMkWu1pE Use AsteriskNOW instead.



rpotthoff
Posts: 146
Member Since:
2006-12-19
Top header

top - 08:56:56 up 2 days, 19:49, 1 user, load average: 0.20, 0.10, 0.02
Mem: 1033624k total, 969992k used, 63632k free, 153376k buffers
Swap: 779144k total, 0k used, 779144k free, 586412k cached



KodaK
Posts: 1885
Member Since:
2006-06-14
That's as I thought. Most

That's as I thought. Most of your "used" RAM is being used by buffers and cache, which is essentially "free" RAM. (Well, more so in the case of cache, as buffers are actually being used by processes.)

I hesitate to say for certain that you don't have a problem, because I'm not there and I can't put my hands on the system, but I will say that it certainly looks like there's nothing wrong. Two big clues that indicate that nothing's wrong: 1) cached memory is over half a gig (normal) and 2) swap isn't touched yet.

There is a Wiki for trixbox over to the left, and in the wiki there is a FAQ. In the FAQ is a section (I just added) about this and it links to a long discussion thread at the gentoo forums about this. If you want to understand RAM usage in Linux, please read that.

This is a good link too:

http://gentoo-wiki.com/FAQ_Linux_Memory_Management

I probably should have used that one in the FAQ. I'll go do that.

Edit: one last thing, you may already know this but if you type "M" while in top it will sort process by memory usage. This is handy if you want to see what's using the most RAM, plus we could tell you if a particular process is using much more than it should.

--

WARNING: I no longer actively participate in these forums. My thoughts on trixbox in a nutshell: http://www.youtube.com/watch?v=q4xBMkWu1pE Use AsteriskNOW instead.



rpotthoff
Posts: 146
Member Since:
2006-12-19
Thanks

Thanks
I will go and look at it, it is nice to get help when you need it!!



KodaK
Posts: 1885
Member Since:
2006-06-14
We see the same questions

We see the same questions over and over and it can get frustrating answering them sometimes. I understand that a new user is almost always overwhelmed (I'm a bit beyond newbie stage and I get overwhelmed sometimes,) but we just ask that people read available documentation.

Granted, in this case nobody bothered to "officially" document it here, but as it's not a trixbox specific thing I can understand why. And there's no reasonable way for a Linux newbie to know that. Regardless, since it comes up so much it's now in the FAQ and if it gets asked again we can point to that instead. :)

--

WARNING: I no longer actively participate in these forums. My thoughts on trixbox in a nutshell: http://www.youtube.com/watch?v=q4xBMkWu1pE Use AsteriskNOW instead.



rpotthoff
Posts: 146
Member Since:
2006-12-19
Again Thanks

Thanks for under standing!
I do have another post that nobody has looked at do you think you could look at it and tell me what i did wrong if anything?
it's about the System backup mod and FTP

I also know to look(search) for other posts and only post when I can not find what I am looking for.



mustardman
Posts: 1289
Member Since:
2006-06-18
I really wish the Trixbox

I really wish the Trixbox people would address this like the FreePBX people have. If your still not convinced this is causing too much confusion here are other previous threads. Pretty much every week another thread starts up.

http://www.trixbox.org/forums/trixbox-forums/help/memory-usage-cl...

http://www.trixbox.org/forums/trixbox-forums/open-discussion/comp...



KodaK
Posts: 1885
Member Since:
2006-06-14
I hardly ever use the

I hardly ever use the trixbox dashboard, preferring instead to go directly to /admin and do what I need to from there.

Can you tell me exactly where the problem is, mustardman? I just went to where I thought it was and I was surprised to see a section that had lines for:

Physical memory
Kernel + apps
Buffers
Cache

Is it the physical memory line that's causing the problem? If so I can take a look and see if I can figure something out.

--

WARNING: I no longer actively participate in these forums. My thoughts on trixbox in a nutshell: http://www.youtube.com/watch?v=q4xBMkWu1pE Use AsteriskNOW instead.



mustardman
Posts: 1289
Member Since:
2006-06-18
I don't use Trixbox. If

I haven't experimented with Trixbox lately. If your looking at the latest FreePBX your good. I believe it's on the main page of the Trixbox GUI unless they actually have addressed this in the latest version.



gmalack
Posts: 2
Member Since:
2008-10-16
RE: This is normal behavior of

You can't say this is normal behavior of linux.... I manage over 50 different linux servers running samba (configured as a PDC), apache web servers, postfix and sendmail email servers, mysql and postgresql database servers, and asterisk VOIP servers (true asterisk, not point and click trixbox). None of my servers run at 97% ram usage. Once they hit 75%, I upgrade the ram.

Not sure what's loaded into trixbox that is causing the ram usage to run high, but I guess that's why I compile everything... I know what's in it and can control what's being used.

Long story short, don't blame the OS... Linux Rocks!



jfinstrom
Posts: 2013
Member Since:
2007-03-07
My

My breakdown:
[leonidas.localdomain ~]# free -m
total used free shared buffers cached
Mem: 1000 770 229 0 151 510
-/+ buffers/cache: 108 891
Swap: 1027 0 1027
[leonidas.localdomain ~]#

A leak would imply growth.

--



jfinstrom
Posts: 2013
Member Since:
2007-03-07
http://gentoo-wiki.com/FAQ_Li

http://gentoo-wiki.com/FAQ_Linux_Memory_Management

Traditional Unix tools like 'top' often report a surprisingly small amount of free memory after a system has been running for a while. For instance, after about 3 hours of uptime, the machine I'm writing this on reports under 60 MB of free memory, even though I have 512 MB of RAM on the system. Where does it all go?

The biggest place it's being used is in the disk cache, which is currently over 290 MB. This is reported by top as "cached". Cached memory is essentially free, in that it can be replaced quickly if a running (or newly starting) program needs the memory.

The reason Linux uses so much memory for disk cache is because the RAM is wasted if it isn't used. Keeping the cache means that if something needs the same data again, there's a good chance it will still be in the cache in memory. Fetching the information from there is around 1,000 times quicker than getting it from the hard disk. If it's not found in the cache, the hard disk needs to be read anyway, but in that case nothing has been lost in time.

To see a better estimation of how much memory is really free for applications to use, run the command free -m:
Code: free -m

total used free shared buffers cached
Mem: 503 451 52 0 14 293
-/+ buffers/cache: 143 360
Swap: 1027 0 1027

The -/+ buffers/cache line shows how much memory is used and free from the perspective of the applications. Generally speaking, if little swap is being used, memory usage isn't impacting performance at all.

Notice that I have 512 MB of memory in my machine, but only 52 is listed as available by free. This is mainly because the kernel can't be swapped out, so the memory it occupies could never be freed. There may also be regions of memory reserved for/by the hardware for other purposes as well, depending on the system architecture. However, 360M are free for application consumption.

--



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.