Files
opentf/vendor/github.com/newrelic/go-agent/internal/sysinfo/memtotal_linux.go
2016-12-15 19:14:59 +00:00

15 lines
259 B
Go

package sysinfo
import "os"
// PhysicalMemoryBytes returns the total amount of host memory.
func PhysicalMemoryBytes() (uint64, error) {
f, err := os.Open("/proc/meminfo")
if err != nil {
return 0, err
}
defer f.Close()
return parseProcMeminfo(f)
}