GoToSocial/vendor/github.com/KimMachineGun/automemlimit/memlimit/exp_system.go

15 lines
243 B
Go
Raw Normal View History

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
}