mirror of https://github.com/shirou/gopsutil
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.
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 | 7 years ago | |
mem_darwin.go | 7 years ago | |
mem_darwin_cgo.go | 7 years ago | |
mem_darwin_nocgo.go | 7 years ago | |
mem_darwin_test.go | 9 years ago | |
mem_fallback.go | 7 years ago | |
mem_freebsd.go | 7 years ago | |
mem_linux.go | 7 years ago | |
mem_openbsd.go | 7 years ago | |
mem_openbsd_amd64.go | 8 years ago | |
mem_solaris.go | 7 years ago | |
mem_test.go | 8 years ago | |
mem_windows.go | 7 years ago | |
types_openbsd.go | 8 years ago |