You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gopsutil/mem
Dimitris Rozakis 4510db20db Always calculate linux used mem as total-(free+buffered+cache)
Used memory was calculated as Total - Available.
For newer kernels (3.14+), available memory is taken from /proc/meminfo,
whereas for older kernels it is computed as free+buffered+cached.

This commit changes that behavior. Available memory is still taken from
/proc/meminfo, if available, but used memory is always computed as
total-free-buffered-cached.

This way, it matches the output of `free` for used memory (in the -/+
buffers/cache line) and other tools.

Prior to this change, I'd see a reported used memory of 600MiB whereas
free, htop and other tools would report a used memory of 1.8GiB. And
adding used, cached, buffered and free memory would leave ~1.2GiB
unaccounted for.
7 years ago
..
mem.go Use static initialisation for invoke instances, instead of init funcs 7 years ago
mem_darwin.go Add WithContext functions. 7 years ago
mem_darwin_cgo.go Add WithContext functions. 7 years ago
mem_darwin_nocgo.go Add WithContext functions. 7 years ago
mem_darwin_test.go add Timeout to invoke command and use common.Invoke refs: #201 9 years ago
mem_fallback.go Add WithContext functions. 7 years ago
mem_freebsd.go Eliminate call to swapinfo on FreeBSD 7 years ago
mem_linux.go Always calculate linux used mem as total-(free+buffered+cache) 7 years ago
mem_openbsd.go Add WithContext functions. 7 years ago
mem_openbsd_amd64.go run go fmt ./... 8 years ago
mem_solaris.go Add WithContext functions. 7 years ago
mem_test.go mem: Skip TestVirtual_memory on Solaris 8 years ago
mem_windows.go Add WithContext functions. 7 years ago
types_openbsd.go run go fmt ./... 8 years ago