In A Row

Get your ducks there!

home :: linux :: out of memory need more ram

:: Am I Running out of Memory?

This was originally authored as a reply to a linode forum poster asking if they needed a virtual server with a larger memory allocation.

I think this tends to be one of those things that nobody can agree on, partially because various common linux tools tend to report memory usage in fairly obtuse and different ways. It's often difficult to find out how much memory you are actually using, because of shared libraries, memory, disk buffers, etc.

I find that using several tools helps to give you a better picture of what's going on with your system.

To see the different output, here's a couple different commands on my linode 450:

:::: cdmoyer:5 ~ :::: free -m
             total       used       free     shared    buffers     cached
Mem:           439        430          8          0         80        224
-/+ buffers/cache:        125        313
Swap:          899          0        899
 
:::: cdmoyer:5 ~ :::: vmstat -a -S M
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r  b   swpd   free  inact active   si   so    bi    bo   in   cs us sy id wa
2  0      0      8     65    328    0    0     0     1   10    2  0  0 100  0
 
:::: cdmoyer:5 ~ :::: vmstat -S M
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
1  0      0      8     80    224    0    0     0     1   10    2  0  0 100  0
 
:::: cdmoyer:5 ~ :::: cat /proc/meminfo
MemTotal:       449604 kB
MemFree:          8604 kB
Buffers:         82828 kB
Cached:         229456 kB
SwapCached:        548 kB
Active:         336360 kB
Inactive:        66676 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       449604 kB
LowFree:          8604 kB
SwapTotal:      921592 kB
SwapFree:       920992 kB
Dirty:              44 kB
Writeback:           0 kB
AnonPages:       90204 kB
Mapped:          37308 kB
Slab:            27536 kB
SReclaimable:    20232 kB
SUnreclaim:       7304 kB
PageTables:       1508 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   1146392 kB
Committed_AS:   195216 kB
VmallocTotal:   397304 kB
VmallocUsed:      2836 kB
VmallocChunk:   394468 kB

What you'll see, the longer your system runs, the less free memory you'll have, even if you don't add any processes. This is because of the cache and buffers. These are used by the kernel to speed things up, and not necessarily memory "used" by the system. Especially the cache. The kernel is just taking advantage of the fact that you have spare memory and keeping things read from disk in memory, for performance. Should you fire up more processes (or they start automatically under load), the kernel will give up parts of that space holding older files that haven't been used in a while.

The other thing to note, is in that both of your cases, basically no swap has been or is being used. That's indicative that even though free claims you have limited memory free, you actually have a lot more headroom. If you start to use swap regularly, or have little free memory without it being used by cache, then you need to consider upgrading your RAM.

Comments

bd_ :: Sat, 09 Feb 2008 23:48

Note that even if you see some swap in use, that doesn't mean that it's a bad thing. The kernel does eventually swap out very infrequently-used pages to make room in the page cache (do you really need lish's getty hanging out in actual memory all the time?). However, if you see regular activity in the si/so columns of vmstat, that is an issue.

PEX tubing :: Tue, 26 Apr 2011 21:56

The lifetime of PEX tubing, during operation with low-temperature coolant and low pressure to 4 bar, is 450 years old, so the pipeline, laid in concrete, is guaranteed to last for the entire lifetime of the building.

lexington law :: Tue, 27 Sep 2011 09:48

I've recently upgraded the RAM allocation from 256 to 450MB on the Linode, and reduced the contention ratio.

Boston home security :: Wed, 23 Nov 2011 07:20

This was quite helpful as my 2 PC's had the same issue. I considered upgrading the RAM and had the better performance. Thanks for explaining this in details and my issues were resolved there after.

Cheap handbags :: Fri, 25 Nov 2011 01:50

Just hope that you will keep publishing such great ones in the future too.

Moncler Down Jackets :: Mon, 28 Nov 2011 01:42

followed as shorts do look superb with Moncler Down Jackets provided they are flawlessly tailored. Even a Cheap Moncler Sale will also be preferred provided you skip knee highs and avoid socks,long Moncler Mens Coats representing a decent look goes with the atmosphere of a boardroom or Bar Mitzvah only. For rest of your life, hemming your moncler vests men sale will be perfect for your relaxed look. The Mens Moncler Jackets Branson Navy Blue can be bare but if covered with pop colored socks will add a nice touch. http://www.monclermensales.com/

Moncler Mens Jackets :: Mon, 28 Nov 2011 01:51

Although Cheap Moncler Uk stated that the tax system shouldn't pick winners and losers, he contradicted himself with Moncler Jackets Sale. If the government maintains the mortgage interest deduction, as Moncler Mens Jackets wants, then selected winners are those Moncler Coats Uk Online enough to have sufficient income and good credit to obtain a mortgage. Selected Moncler Womens Jackets are anyone who doesn't own a piece of winter jackets and those who've paid off their http://www.moncleruk4sale.com/.

Christian Louboutin Boots :: Mon, 28 Nov 2011 01:59

Christian Louboutin Boots are extremely mechanical inside the procedure of producing or breaking any dressing Discount Christian Louboutin Sale. And no one of us would actually want their respective type to go as Sales Louboutin. And women are especially extra delicate with these problems associated to styling than their Cheap Louboutin Pumps. These Fashion Shoes play a pivotal transfer from transforming a flop model to Christian Louboutin Sandals as they gel correctly even together with your standard Christian Louboutin Booties. So, make sure to play it intelligent on this occasion, go for http://www.saleslouboutinboots.com/ and get prepared to get all these appreciative attentions. For the nba, and for all those nba shoes this year, you can’t go wrong with nba players shoes. Basketball shoes are men’s favorite that never really seem to completely go out of style although cheap nba jerseys can wax and wane as often as the moon. They’re superb in nba shoes sales, but beyond these locations could perhaps not be the finest choice. Still, they do have their place and selected best nba shoes can utilize an outstanding pair of Kobe Bryant Shoes much more effectively than others. But moving beyond these basic carefree Dwight Howard Shoes, there can be plenty of comfy, cool sneakers that are going to http://www.nbaplayerssshoe.com/favored all through the coming year.

north face outlet :: Wed, 30 Nov 2011 03:02

This is a great news,which has a lot of readers.Such kind of post giving us various knowaledge,it worthy to read.It is so wonderful.

north face fleece jackets :: Wed, 30 Nov 2011 08:06

north face fleece jackets

Womens Designer Clothing :: Thu, 08 Dec 2011 09:07

Women enjoy <a href="http://www.womensdesignershop.com/">Womens Designer Clothing</a> and if they're designer the better as this translates to style <a href="http://www.womensdesignershop.com/">Women Shopping</a>, elegance, and quality. <a href="http://www.womensdesignershop.com/">Womens Designer</a> item are made with the finest materials. Fashion is all that everyone wants and right now generation <a href="http://www.womensdesignershop.com/">Womens Designer Shops</a> matters much more than money.

Raleigh home security systems :: Sat, 31 Dec 2011 15:25

May be the memory is the issue. Let me check this with my colleague and get back to you with any solutions.

New York City Home Security :: Wed, 04 Jan 2012 07:19

I am not sure about this but have asked my friend who can really help you in this. Seems to be OK but still not sure.

s.t. dupont lighter :: Fri, 03 Feb 2012 03:01

I feel great to write this article, which share a lot of things, I learned a lot of knowledge from which to learn more things.

Add a Comment:
 
Name:
URL/Email: [http://... or mailto:you@wherever] (optional)
Comment:
Please verify that you are human, or a good AI/OCR combo:
  Add to Technorati Favorites   Copyright 2008, Chris Moyer