summaryrefslogtreecommitdiff
path: root/vendor/github.com/KimMachineGun/automemlimit/memlimit/exp_system.go
blob: dee95f5207855edc1f0e84dfa72c8452e19ee487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package memlimit

import (
	"github.com/pbnjay/memory"
)

// FromSystem returns the total memory of the system.
func FromSystem() (uint64, error) {
	limit := memory.TotalMemory()
	if limit == 0 {
		return 0, ErrNoLimit
	}
	return limit, nil
}