mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
15 lines
310 B
Go
15 lines
310 B
Go
|
package memory
|
||
|
|
||
|
import (
|
||
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
||
|
)
|
||
|
|
||
|
// This has been adapted from github.com/pbnjay/memory.
|
||
|
func sysTotalMemory() int {
|
||
|
s, err := sysctlUint64("hw.memsize")
|
||
|
if err != nil {
|
||
|
logger.Panicf("FATAL: cannot determine system memory: %s", err)
|
||
|
}
|
||
|
return int(s)
|
||
|
}
|