mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
8b7917cd81
See https://tip.golang.org/doc/go1.17#gofmt for more details
18 lines
420 B
Go
18 lines
420 B
Go
//go:build freebsd || openbsd || dragonfly || netbsd
|
|
// +build freebsd openbsd dragonfly netbsd
|
|
|
|
package memory
|
|
|
|
import (
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
|
)
|
|
|
|
// This code has been adopted from https://github.com/pbnjay/memory
|
|
|
|
func sysTotalMemory() int {
|
|
s, err := sysctlUint64("hw.physmem")
|
|
if err != nil {
|
|
logger.Panicf("FATAL: cannot determine system memory: %s", err)
|
|
}
|
|
return int(s)
|
|
}
|