shirou_gopsutil/mem
Cameron Sparr ce70817f55 Fix memory reporting for linux systems
/proc/meminfo reports memory in KiloBytes and so needs a multiplier of
1024 instead of 1000.
The kernel reports in terms of pages and the proc filesystem is left
shifting by 2 for 4KB pages to get KB. Since this is a binary shift,
Bytes will need to shift by 10 and so get multiplied by 1024.

From the kernel code. PAGE_SHIFT = 12 for 4KB pages
"MemTotal:       %8lu kB\n", K(i.totalram)

Thanks to @subhachandrachandra!
2015-08-27 09:41:19 -06:00
..
mem.go change package name. 2014-12-30 22:09:05 +09:00
mem_darwin.go memory[darwin]: return value of "sysctl hw.memsize" is memory size in bytes. 2015-08-16 16:32:53 +09:00
mem_freebsd.go change package name. 2014-12-30 22:09:05 +09:00
mem_linux.go Fix memory reporting for linux systems 2015-08-27 09:41:19 -06:00
mem_test.go change package name. 2014-12-30 22:09:05 +09:00
mem_windows.go change package name. 2014-12-30 22:09:05 +09:00