Documentation
¶
Index ¶
- Constants
- Variables
- func ForceReadMemStats() *runtime.MemStats
- func GetMemTotalIgnoreErr() uint64
- func InstanceMemUsed() (uint64, error)
- func MemTotalCGroup() (uint64, error)
- func MemTotalNormal() (uint64, error)
- func MemUsedCGroup() (uint64, error)
- func MemUsedNormal() (uint64, error)
- func ReadMemStats() (memStats *runtime.MemStats)
Constants ¶
const ReadMemInterval = 300 * time.Millisecond
ReadMemInterval controls the interval to read memory stats.
Variables ¶
var ( ServerMemoryLimitOriginText = atomicutil.NewString("0") ServerMemoryLimit = atomicutil.NewUint64(0) ServerMemoryLimitSessMinSize = atomicutil.NewUint64(128 << 20) QueryForceDisk = atomicutil.NewInt64(0) TriggerMemoryLimitGC = atomicutil.NewBool(false) MemoryLimitGCLast = atomicutil.NewTime(time.Time{}) MemoryLimitGCTotal = atomicutil.NewInt64(0) )
Process global variables for memory limit.
var MemTotal func() (uint64, error)
MemTotal returns the total amount of RAM on this system
var MemUsed func() (uint64, error)
MemUsed returns the total used amount of RAM on this system
Functions ¶
func ForceReadMemStats ¶
ForceReadMemStats is to force read memory stats.
func GetMemTotalIgnoreErr ¶
func GetMemTotalIgnoreErr() uint64
GetMemTotalIgnoreErr returns the total amount of RAM on this system/container. If error occurs, return 0.
func InstanceMemUsed ¶
InstanceMemUsed returns the memory usage of this process
func MemTotalCGroup ¶
MemTotalCGroup returns the total amount of RAM on this system in container environment.
func MemTotalNormal ¶
MemTotalNormal returns the total amount of RAM on this system in non-container environment.
func MemUsedCGroup ¶
MemUsedCGroup returns the total used amount of RAM on this system in container environment.
func MemUsedNormal ¶
MemUsedNormal returns the total used amount of RAM on this system in non-container environment.
func ReadMemStats ¶
ReadMemStats read the mem stats from runtime.ReadMemStats
Types ¶
This section is empty.