On Tue, 2008-04-22 at 00:38 +0300, Oded Arbel wrote: > Hi List > > > One of my servers is acting very strangely memory wise - it has 4GB of > memory and it is always full, and I don't mean in the "not a lot of free > memory" kind of full, but in the "application memory takes more then > 3GB" kind of full. > > I ran a simple script to compare how many resident memory PS reports > compared to what free reports is being used for stuff other then cache > and buffers, and I got these interesting results: > > This is a normal which is very loaded and by right - it has a java > application which is set to 2GB heap and uses it just fine: > > # ps auwx | perl -nle 'split/\s+/; $sum += $_[5]; END { print "sum: > $sum"; }'; free > sum: 3158192 > total used free shared buffers > cached > Mem: 4063412 4029396 34016 0 20016 > 360368 > -/+ buffers/cache: 3649012 414400 > Swap: 4194296 354188 3840108 > > So we can see PS reports 3.1GB is used by applications and free reports > 3.6GB of used memory (except buffers and cache). so I'm missing about > half a gig, but I don't mind that much. > > Here is the broken server: > > # ps auwx | perl -nle 'split/\s+/; $sum += $_[5]; END { print "sum: > $sum"; }'; free > sum: 1367356 > total used free shared buffers > cached > Mem: 4063412 4038212 25200 0 35604 > 726268 > -/+ buffers/cache: 3276340 787072 > Swap: 4194296 656508 3537788 > > which is mind boggling - there's a 2GB difference, about half my total > amount of memory! Where did all my memory gone too ? > > Now that server is also constantly spends tons of time in kswapd and on > IO - thrashing if you want and I'm not sure if its a symptom or the > cause. > > Do note that both are production servers and I can't really restart them > or anything, even taking down services is a long and annoying process.
I just noticed something else - both servers are running MySQL, and I'm using htop (instead of top) to look at processes. Now in the "good server" htop lists MySQL memory share as 8.5% and the numbers are VIRT=615M and RES=329M , while in the "bad server" htop list MySQL as using VIRT=1364M and RES=409M but lists it as only 3.8% of memory ?!? both servers carry the same 4GB of physical memory and 4GB swap. -- Oded ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]