Documentation
¶
Index ¶
Constants ¶
View Source
const ( B = 1 KiB = 1 << (10 * iota) // 2^10 MiB = 1 << (10 * iota) // 2^20 GiB = 1 << (10 * iota) // 2^30 TiB = 1 << (10 * iota) // 2^40 )
Variables ¶
View Source
var ErrNotEnoughMemory = fmt.Errorf("not enough memory")
Functions ¶
func LiveHeapReader ¶ added in v1.22.5
func LiveHeapReader() int64
Types ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor allows making statements about the memory ratio used by the application
func NewMonitor ¶
NewMonitor creates a Monitor with the given metrics reader and target ratio
Typically this would be called with LiveHeapReader and debug.SetMemoryLimit
func (*Monitor) CheckAlloc ¶ added in v1.22.0
Click to show internal directories.
Click to hide internal directories.