Incorrect Percentage for Memory Utilization.

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Incorrect Percentage for Memory Utilization.
# 1  
Old 04-21-2016
Incorrect Percentage for Memory Utilization.

I am running the command
Code:
/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@linuxtest ~]$ free -b
             total       used       free     shared    buffers     cached
Mem:    1353938452 1348477050  546140160 3532815564  163950592 1319080386
-/+ buffers/cache: 2775715840 1326181294
Swap:   1677721190   57024512 1672018739


Last edited by jim mcnamara; 04-21-2016 at 11:58 AM.. Reason: [mod]Please use code tags[/mod]
# 2  
Old 04-21-2016
Are you aware that in the buffers/cache: line the fields are shifted by one due to the -/+ field at BOL?
# 3  
Old 04-21-2016
Yes it looks like the numbers are incorrect and shifted (column width limitations?)
Try with free -m instead.
But probably it is better to use /proc/meminfo , since recent versions of free no longer have a -/+ buffers/cache: line and have an available column instead...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Working out percentage of memory utilization

Hi there I am middle of writing a script to allow me to see the % of the memory which is being used. When I submit my script I don't get any errors but I just get a blank output. Any pointers? available=`free -m | grep available` if then ... (7 Replies)
Discussion started by: simpsa27
7 Replies

2. AIX

Need help on memory utilization.

I have run the utility nmon in aix 6.1, and found memory utilization is 99.9% in physical. and pressed h key and then t , in that it is not showing single process which is consuming memory resources. please help me how to find out actual memory utilization. wheather 99% is real memory... (1 Reply)
Discussion started by: manoj.solaris
1 Replies

3. Red Hat

CPU Utilization and Memory Utilization of Services and Applications

Hi, i am new to linux/RHEL 6.0 and i have two questions. 1) How to get the CPU utilization and Memory Utilization of all Services running currently? 2) How to get the CPU utilization and Memory Utilization of all Applications running currently? Please help me to find the script. ... (2 Replies)
Discussion started by: nossam
2 Replies

4. Solaris

[DOUBT] Memory high in idle process on Solaris 10 (Memory Utilization > 90%)

Hi Experts, Our servers running Solaris 10 with SAP Application. The memory utilization always >90%, but the process on SAP is too less even nothing. Why memory utilization on solaris always looks high? I have statement about memory on solaris, is this true: Memory in solaris is used for... (4 Replies)
Discussion started by: edydsuranta
4 Replies

5. HP-UX

memory utilization

command for checking memory utilization in HP -UX (2 Replies)
Discussion started by: tushar_spatil
2 Replies

6. Shell Programming and Scripting

Calculating Swap percentage utilization

Hello All, I am trying to create a script that will give me the processes that consume swap in %. i am using the below line to get it done. virtual=`echo "$virtual/$swp*100"|bc -l|sed -e "s/\(\.\).*/\1/g"` but getting the following output after running it. .039 .110 I want the... (3 Replies)
Discussion started by: ajaincv
3 Replies

7. AIX

Memory Utilization

Hi friends i have a query. we have two p-series machine(p550 & p570) with HACMP 5.3 and AIX 5.3 hosting SAP. Now i need to now is there a way or a command to check the memory utilization on these machines on daily basis. I have tried vmstat and iostat but still it's not clear. We have... (3 Replies)
Discussion started by: nathandrake13
3 Replies

8. UNIX for Advanced & Expert Users

memory configuration incorrect?

MIS/IT Area - Sun: Solaris Forum eb222 (MIS)3 replies20 Mar 07 (20 Mar 07) something wrong with my memory bank table I have run prtdiag and the memory bank table doesnt look right -can somebody confirm if below looks ok? ============================ Memory Configuration... (1 Reply)
Discussion started by: eb222
1 Replies

9. AIX

Memory Utilization

All, The (fre) coloumn of the (vmstat) command, does it report the size of the free list including the swap space or it only report on the RAM (physical memory). BR, (1 Reply)
Discussion started by: Negm
1 Replies

10. HP-UX

How to determine cpu&memory percentage usage per user

Using HP-UX v11 Need to monitor cpu and memory usage, total for system and separately for each user in command-line mode. Found out next ways to monitor total cpu usage under hp-ux: 1) vmstat, also shows free memory 2) sar -M ps -eo user,pcpu - does not work, means 'user-defined format'... (4 Replies)
Discussion started by: hp-ux-user
4 Replies
Login or Register to Ask a Question