Simple question about vmstat

Hi friends,

I have confusion about VMSTAT command.

  1. When I execute "vmstat" command without any interval then I got something like following output.
vmstat
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr m1 m1 m1 m3   in   sy   cs us sy id
 2 573 0 5494680 6128480 2534 2256 18013 5 4 0 0 1 0 4 1 595 3713 1125 55 12 33

It indicates around 6GB free memory.

  1. When I execute "vmstat 5 10" command (with intervals) then I am getting following
procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr m1 m1 m1 m3   in   sy   cs us sy id
 1 539 0 5355432 5939368 2503 2212 17903 5 4 0 0 1 0 5 1 632 1089 668 54 12 34
 0 858993236 0 1420912 1440816 157 6020 268 26 26 0 0 0 0 3 0 872 23166 5697 39 11 51

It indicates around 1.2 GB free memory.

Why this is happening. What is the different between those 2 commands. What is actual free memory?

Thanks and regards,
Rahul

the first line is always the average value for the whole uptime of the machine. so all other lines are the current values...

procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr m1 m1 m1 m3   in   sy   cs us sy id
 1 539 0 5355432 5939368 2503 2212 17903 5 4 0 0 1 0 5 1 632 1089 668 54 12 34
 0 858993236 0 1420912 1440816 157 6020 268 26 26 0 0 0 0 3 0 872 23166 5697 39 11 51

858 millions threads hanging in the blocked queue is quite impressive ...

1 Like

wow... didn't even take a look at the output... that's realy impressive! maybe a fork bomb :wink:

1 Like

858 millions threads hanging in the blocked queue is quite impressive ...
didn't even take a look at the output... that's realy impressive! maybe a fork bomb

What you mean? Kindly explain me to understand. Does it something wrong? Please advice.

Well, my first guess is that value is bogus.

What says

prstat -a 1 1 | tail -1

?

and a longer vmstat output (more lines) might also be usefull...

its always advisable to take the

vmstat 5 5 

or even with longer interval..as it gives a stable o/p for the last 4 intervals..The 1st interrogation denotes the average value for the m/c since it was rebooted..However the subsequent values show the current status...Hence alwyas try to notice o/p from a longer interval and for a relatively larger number of interrogations

@rahul_switch: my suggestion was wrong, please run:

prstat -a 1 1 | tail -1

and post its output.

Hi,

Please find both output.

/var/home/oracle: > vmstat 5 5
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr m1 m1 m1 m3 in sy cs us sy id
1 513 0 5240680 5790352 2486 2198 17895 5 4 0 0 1 0 5 1 666 1168 856 53 12 35
0 858993228 0 1695848 1657176 2620 2345 20271 2 0 0 0 15 2 20 15 2333 21471 8521 19 10 71
0 858993228 0 1659504 1613320 1849 4123 20977 6 2 0 0 0 0 3 0 1918 22161 7849 22 9 69
0 858993227 0 1622512 1597896 1758 573 21758 3 3 0 0 0 0 2 0 2109 20968 8415 17 6 77
0 858993227 0 1622352 1577920 2091 278 24043 0 0 0 0 0 0 0 0 2314 21192 8796 19 7 74
/var/home/oracle: > prstat -a 1 1 | tail -1
Total: 191 processes, 1403 lwps, load averages: 2.71, 2.53, 2.34
/var/home/oracle: >

(kindly note given output is from live production server)

Thanks and regards,
Rahul

looks like your hardware is a little bit out of league... what hardware do you use?

There are 1403 lwps (i.e. threads) on your system so there can't be 858993228 of them in the wait queue.

Hi,
It is Sun Sparc 5.8 Generic 108528-29. I don't know more about same.

Thanks and regards,
Rahul

You OS hasn't been patched for 6 years. No surprise if a bug shows up. Nothing to worry about vmstat output, probably a 32 bit counter that overflowed.