We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06a5e24 commit 0f754f0Copy full SHA for 0f754f0
cli/clistat/stat.go
@@ -186,6 +186,10 @@ func (s *Statter) HostMemory() (*Result, error) {
186
return nil, xerrors.Errorf("get memory info: %w", err)
187
}
188
r.Total = ptr.To(float64(hm.Total))
189
- r.Used = float64(hm.Used)
+ // On Linux, hm.Used equates to MemTotal - MemFree in /proc/stat.
190
+ // This includes buffers and cache.
191
+ // So use MemAvailable instead, which only equates to physical memory.
192
+ // On Windows, this is also calculated as Total - Available.
193
+ r.Used = float64(hm.Total - hm.Available)
194
return r, nil
195
0 commit comments