memory

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLiveDatasetSize

func GetLiveDatasetSize() uint64

GetLiveDatasetSize returns the live dataset size in bytes which required by calculating GOGC since go1.19,

gcPercentHeapGoal = c.heapMarked + (c.heapMarked+c.lastStackScan.Load()+c.globalsScan.Load())*uint64(gcPercent)/100

There are some metrics be added in go1.21 to accurately get `heapMarked` and `lastStackScan`, use `/gc/heap/live:bytes` metric as `heapMarked`, and use `/gc/scan/stack:bytes` metric as `lastStackScan`

func GetMemoryFree

func GetMemoryFree() uint64

GetMemoryFree returns memory free

func GetMemoryLimit

func GetMemoryLimit() uint64

GetMemoryLimit returns system memory limit if cgroup is used, it returns cgroup memory limit

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL