LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 04-21-2016, 10:34 AM   #1
manoj.linux
Member
 
Registered: Aug 2007
Posts: 280

Rep: Reputation: 17
Question Need Help to find out correct Memory Utilization.


I need help to find correct memory utilization, I have run the below command.

/usr/bin/free -b | awk '/Mem:|cache:/ {print $2,$3}' | sed 'N;s/\n/ /' | awk '{print ($4*100)/$1}'
to find out Memory utilization,


it is showing 205%, please suggest me what changes are required, below is output of free -b command.



Code:
[test@test ~]$ free -b
total used free shared buffers cached
Mem: 1353938452 1348477050 546140160 3532815564 163950592 1319080386
-/+ buffers/cache: 2775715840 1326181294
Swap: 1677721190 57024512 1672018739
 
Old 04-21-2016, 11:36 AM   #2
Mitt Green
Member
 
Registered: May 2014
Location: Europe
Posts: 199

Rep: Reputation: 106Reputation: 106
I use vmstat instead of free. Considering your output of vmstat -s starts with
Code:
[some numbers] K total memory
[some numbers] K used memory
there is your memory usage in %:
Code:
vmstat -s | awk 'NR==1,NR==2 {print $1}' ORS=' ' | awk '{printf "%3.2f\n", $2 / $1 * 100}'
 
Old 04-21-2016, 12:02 PM   #3
cnamejj
Member
 
Registered: Mar 2015
Distribution: Ubuntu
Posts: 37

Rep: Reputation: Disabled
Another option...

Code:
sar -r 1 1 | awk '$1 == "Average:" { print $4 }'
 
Old 04-21-2016, 12:53 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,381

Rep: Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574
Quote:
Originally Posted by manoj.linux View Post
I need help to find correct memory utilization, I have run the below command.
/usr/bin/free -b | awk '/Mem:|cache:/ {print $2,$3}' | sed 'N;s/\n/ /' | awk '{print ($4*100)/$1}'
to find out Memory utilization,

it is showing 205%, please suggest me what changes are required, below is output of free -b command.
AGAIN????
You asked about memory utilization EIGHT YEARS AGO, and have been given numerous answers over the years...is there some point at which you'll begin to read/understand those answers, and perhaps do your own research?

http://www.linuxquestions.org/questi...nd-4175554806/
http://www.linuxquestions.org/questi...on-4175458903/
http://www.linuxquestions.org/questi...memory-625772/
http://www.linuxquestions.org/questi...zation-640241/
http://www.linuxquestions.org/questi...-usage-920167/
http://www.linuxquestions.org/questi...zation-933553/
 
Old 04-21-2016, 01:12 PM   #5
Mitt Green
Member
 
Registered: May 2014
Location: Europe
Posts: 199

Rep: Reputation: 106Reputation: 106
Quote:
Originally Posted by TB0ne View Post
AGAIN????
You asked about memory utilization EIGHT YEARS AGO, and have been given numerous answers over the years...is there some point at which you'll begin to read/understand those answers, and perhaps do your own research?

http://www.linuxquestions.org/questi...nd-4175554806/
http://www.linuxquestions.org/questi...on-4175458903/
http://www.linuxquestions.org/questi...memory-625772/
http://www.linuxquestions.org/questi...zation-640241/
http://www.linuxquestions.org/questi...-usage-920167/
http://www.linuxquestions.org/questi...zation-933553/
Ahahahaha
 
Old 04-21-2016, 04:26 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Mitt Green View Post
Ahahahaha
After 8 years of anything, and I don't care what it is, they are not a "newbie".

Mark Seger even replied and told him about collectl and here also!
If Mark Seger told me to break glass and shove it up my nose while installing collectl, I'd be breaking bottles all over my desk.

To the OP. I suggest you start adding "h" to the free command.
Code:
free -boh
             total       used       free     shared    buffers     cached
Mem:           15G        10G       5.4G        37M       486M       7.5G
Swap:         4.7G         0B       4.7G
or
Code:
free -bh
             total       used       free     shared    buffers     cached
Mem:           15G        10G       5.4G        37M       486M       7.5G
-/+ buffers/cache:       2.3G        13G
Swap:         4.7G         0B       4.7G
Or use awk, vnstat, sar, or collectl, toss in a search engine...
Hire someone, buy books.

The good news is now all his "Memory Utilization" posts are all summarized in one place thanks to TB0nes'
dutifulness.

See also http://www.cyberciti.biz/faq/linux-check-memory-usage/

And what the heck does "correct Memory Utilization" mean?
What is incorrect Memory Utilization?

I'm with TB0ne on this one.

End Transmission.

Last edited by Habitual; 04-21-2016 at 04:38 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory Utilization manoj.linux AIX 2 04-23-2013 12:30 AM
How to find memory utilization of particular process in linux in GB LittleMaster Linux - Newbie 3 11-02-2012 12:56 PM
Memory utilization Ammad Linux - General 3 03-30-2011 10:15 AM
Memory utilization is 99% arunabh_biswas Red Hat 3 10-08-2009 11:00 AM
ni52 can't find memory, but address correct Wim_Woittiez Linux - Hardware 0 12-01-2003 01:14 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 12:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration