Hi,
I got a 2GB memory droplet and seems like my free-m is not couting correct my free memory OR something is using more than it should…
I did some reasearch and i found that i can “count” my usar memory by this command:
ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS
Quick math all my main process are using 500MB memory… with the minor ones… it should reach 600MB top.
but free -m show that i only have 300MB left… and 800MB cached…
Just to you know i running 4 nodejs applications (3 ghost blogs and 1 express)
Any thoughts about it?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
On Linux, cached memory is still available for use. So when looking at the output of free -m the “available” column is likely what you want to be looking at rather than the “free” one.
The output of ps can also be a bit misleading. This blog post covering memory usage on Linux has a good explanation:
Why ps is “wrong”
Depending on how you look at it, ps is not reporting the real memory usage of processes. What it is really doing is showing how much real memory each process would take up if it were the only process running. Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely “wrong”. In order to understand why, it is necessary to learn how Linux handles shared libraries in programs.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.