Score:0

Get the actual value of free memory is sun sparc

la flag

I am trying to get the current (not the average) free memory size of SUN SPARC remote server, but I don't have the permission to use free -m command or prtconf. So, I used command vmstat 2 and the result is kthr memory page disk faults cpu

r b w   swap  free  re  mf pi po fr de sr vc vc vc vc   in   sy   cs us sy id

0 0 0 46981864 20824288 311 416 51 1 1 0 0 27 6  0 18 16070 33290 17580 12 2 87

0 0 0 45534984 9138264 127 405 0 0 0 0  0  0  0  0 32 17427 45040 20877 25 2 73

0 0 0 45534984 9138072 208 510 0 0 0 0  0  7  0  0  0 14544 35758 17416 23 2 75

0 0 0 45534984 9138072 96 324 0 0 0  0  0  0  0  0 63 6443 11683 5701 11 1 89

and vmstat| awk '{print $5}' and the result is 20824288 which is the average not the current value ,so how to get the actual value ?

Score:0
in flag

You can use command like:

vmstat 1 3|tail -1 |awk '{print $5}'

The idea is to exec vmstat 3 times (the first execution get average values from the start of the system), get last line and extract free memory value.

Score:0
in flag

I suggest to use top's output:

top | awk '/free mem$/{print $5}'

Output (example):

3201M
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.