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.
/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! |
10 years ago | |
---|---|---|
.. | ||
mem.go | 10 years ago | |
mem_darwin.go | 10 years ago | |
mem_freebsd.go | 10 years ago | |
mem_linux.go | 10 years ago | |
mem_test.go | 10 years ago | |
mem_windows.go | 10 years ago |