Skip to content

Commit

Permalink
util: fix wrong calculation to get memory usage. (#21158) (#21160)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Nov 20, 2020
1 parent 485833e commit 2dbe7b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/memory/meminfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ func MemTotal() (uint64, error) {
// MemUsed returns the total used amount of RAM on this system
func MemUsed() (uint64, error) {
v, err := mem.VirtualMemory()
return v.Total - (v.Free + v.Buffers + v.Cached), err
return v.Used, err
}

0 comments on commit 2dbe7b2

Please sign in to comment.