0% found this document useful (0 votes)
25 views

How To Calculate SAR and VMSTAT Memory Values: Ksar Graphical Tool

The document discusses how to calculate memory values from sar and vmstat outputs. SAR and vmstat provide free memory and swap space values, but in different formats. SAR values need to be converted from pages to GB by multiplying by the page size and dividing by 1024^3. Vmstat values are directly in KB and can be converted to GB by dividing by 1024^2. On average, the example system had 52.77GB of free memory and 42.74GB of free swap space according to SAR, and 52.74GB of free memory and 42.82GB of free swap space according to vmstat.

Uploaded by

raghurampola
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

How To Calculate SAR and VMSTAT Memory Values: Ksar Graphical Tool

The document discusses how to calculate memory values from sar and vmstat outputs. SAR and vmstat provide free memory and swap space values, but in different formats. SAR values need to be converted from pages to GB by multiplying by the page size and dividing by 1024^3. Vmstat values are directly in KB and can be converted to GB by dividing by 1024^2. On average, the example system had 52.77GB of free memory and 42.74GB of free swap space according to SAR, and 52.74GB of free memory and 42.82GB of free swap space according to vmstat.

Uploaded by

raghurampola
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

How to calculate SAR and VMSTAT memory

values
Most of the UNIX beginners are very confused with sar and vmstat outputs.In most of the occasion they
are not able to determine the free memory and free swap in order to find the memory bottleneck.Not
all the time top command will give right values. Ksar graphical tool also very useful to analysis
bottleneck.
SAR:
Now we will see how to calculate free memory and swap
Formula:
Free memory in GB= freemem*pagesize/1024/1024/1024
Free swap in GB=freeswap*512/1024/1024/1024
To find the page size value,
[root@wSolarisN ~]# pagesize
8192
FYI:In x86 pagesize value is 4k and in SPARC its 8k.
As per the above commands output,
Free memory in GB =6917436*8192/1024/1024/1024=52.77GB
Free swap in GB=89634194*512/1024/1024/1024=42.74GB
[root@solarisN~]# sar -r 5 5
SunOS SolarisN 5.10 Generic_147440-09 sun4v

03/12/2013

08:16:18 freemem freeswap


08:16:23 6916895 89225128
08:16:28 6918127 89796122
08:16:34 6917438 89645747
08:16:39 6917972 89797936
08:16:45 6916954 89760317
Average

6917436 89634194

VMSTAT:
vmstat will provide the free memory and free swap in KB .So its very easy to calculate unlike the SAR
values.
Formula:
Free memory in GB=value/1024/1024
Free swap in GB=value/1024/1024
Free swap in GB=44905096/1024/1024=42.82GB
Free memory in GB=55305768/1024/1024=52.74GB
[root@solarisN ~]# vmstat 5 5
kthr
r b w

memory
swap

free

page
re

disk

faults

mf pi po fr de sr m1 m1 m1 m2

in

sy

cpu
cs us sy id

6 0 0 96425064 87221048 18 63 10 0 0 0

4 81

921

923

908

0 98

1 0 0 44907344 55306816 1 6 0

961 1254

954

0 99

3 0 0 44854688 55307016 1 1 0

945 1216

936

0 99

13 0 0 44912064 55312408 1 2 0 0

944 1221

943

0 99

1 0 0 44905096 55305768 1 2 0

969 1274

966

0 99

You might also like