[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

need explanation linux command "free -m"

Posted on 2010-09-03
6
Medium Priority
?
1,181 Views
Last Modified: 2013-12-06
Hello,

I need more explanation of "free -m" linux command.

[root@xxxxxx /]# free -t -m
             total       used       free     shared    buffers     cached
Mem:          2026       1817        208          0        404       1035
-/+ buffers/cache:        377       1648
Swap:         2047         17       2030
Total:        4074       1835       2238

Open in new window


As shown, we have 2G total, 1.8G used and 208 Megs free. Everybody will say that we need RAM, but
inline total : 4G total, 1.8G used, 2.2G free, so do I really need more memory ?

Is it good to use swap memory ?

We ask this question because the server is suddenly slow.

see this image ( Plesk shows 40% of memory used ) ?
 comparaison between 'free -m' and Plesk.
thanks,
0
Comment
Question by:dom_solariumdeparis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:flubbard
ID: 33597892
Couple things.  first off, free is only showing your usage as of the present time.  Generally, you will have some things going to swap and that is not a problem.  You would prefer active applications to not use swap instead of physical memory simply because there is no physical memory left...that would be bad.

That being said.  If you are bumping up that close to physical ram, you probably would benefit from adding some.  

As an aside, to find out more information on any linux command, look at the manual.  You can access the manual by typing:
# man [application]

for example:
# man free

hth - flub
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33598672
Hi!

I'd say you need more RAM. The swap is very slow compared to RAM. Try to use the 'top' command to see which processes that use your RAM. Sorting by memory usage (SHIFT-O n ENTER) will sort the top output by memory usage.

Regards, Tobias
0
 

Author Comment

by:dom_solariumdeparis
ID: 33599293
Hello TobiasHolm,

see picture of the output of Top.
Do you see which processes that it use a lot of memory ?

regards,
free-m-2.JPG
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 18

Expert Comment

by:TobiasHolm
ID: 33599401
You must use sudo to start top to see processes from all users.

sudo top

You can also use ps to see where the memory are used:
sudo ps aux

Regards, Tobias
0
 
LVL 25

Expert Comment

by:madunix
ID: 33600527
If your machine uses a lot of swap then you should really think about tuning the system and then adding more memory
0
 
LVL 4

Accepted Solution

by:
kareejb earned 2000 total points
ID: 33603864
The Linux kernel uses as much ram as possible for caching recently used data and for data buffers to increase overall system performance/responsiveness. Linux will dynamically increase or decrease these pools of memory as needed. The line you need the pay attention to is the the one '-/+ buffers/cache:        377       1648'. This means without buffers and cache you are only using 377MB of ram and have 1648MB free available for programs. If you have swap space defined the Linux kernel will use it if it determines that swapping a sleeping process's memory out to disk in favor of additional buffer space or cache would lead to better overall system performance. In your case you have only 17MB of swap in use. Windows 2000/XP/2003 function similarly but are no where near as aggressive. Windows Vista/7/Server 2008 are more akin to Linux in this respect.

So in your case you don't need any more memory and in all actuality you could make do with as little as 512MB of RAM with only a slight impact on performance.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question