In attempting to calculate the free memory under Solaris 10, I noticed I get different results using vmstat versus kstat or mdb.
The basic commands:
/usr/bin/kstat -p unix::system_pages:freemem | cut -f 2
/usr/bin/vmstat 1 1 | tail -1 | awk '{ print $5 / 1024 }'
echo ::memstat | mdb -k | awk '/cachelist/ { print $4 }'
echo ::memstat | mdb -k | awk '/freelist/ { print $4 }'
The kstat and (the two) memstat commands give essentially identical results 147266MB, whereas the vmstat command returns 167030MB.
Can someone explain the difference please?