mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-30 07:40:06 +01:00
18 lines
367 B
Go
18 lines
367 B
Go
|
// +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)
|
||
|
}
|