Documentation
¶
Index ¶
- Constants
- func EstimateBatchObjectMemory(object *protocol.BatchObject) int64
- func EstimateObjectDeleteMemory() int64
- func EstimateObjectMemory(object *models.Object) int64
- func EstimateStorObjectMemory(object *storobj.Object) int64
- func LiveHeapReader() int64
- type AllocChecker
- type Monitor
- func (m *Monitor) CheckAlloc(sizeInBytes int64) error
- func (m *Monitor) CheckMappingAndReserve(numberMappings int64, reservationTimeInS int) error
- func (m *Monitor) MappingsReadDue(now time.Time) bool
- func (m *Monitor) Ratio() float64
- func (m *Monitor) ReadMappings(now time.Time) error
- func (m *Monitor) Refresh(updateMappings bool)
Constants ¶
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 )
const (
MappingDelayInS = 2
)
Variables ¶
This section is empty.
Functions ¶
func EstimateBatchObjectMemory ¶ added in v1.36.0
func EstimateBatchObjectMemory(object *protocol.BatchObject) int64
EstimateBatchObjectMemory sums every vector source the object carries. An object may hold the legacy vector, the byte vector, and named or multi vectors at once, and the memory check must count all of them. The 30 byte overhead is per object, as in the other estimators in this file.
func EstimateObjectDeleteMemory ¶ added in v1.24.9
func EstimateObjectDeleteMemory() int64
func EstimateObjectMemory ¶ added in v1.24.9
func EstimateStorObjectMemory ¶ added in v1.27.0
func LiveHeapReader ¶ added in v1.22.5
func LiveHeapReader() int64
Types ¶
type AllocChecker ¶ added in v1.24.9
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor allows making statements about the memory ratio used by the application
func NewDummyMonitor ¶ added in v1.24.9
func NewDummyMonitor() *Monitor
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
func (*Monitor) CheckMappingAndReserve ¶ added in v1.24.9
func (*Monitor) MappingsReadDue ¶
MappingsReadDue reports whether the memory mappings should be read at now.
func (*Monitor) ReadMappings ¶
ReadMappings counts the mappings in mapsPath and records now as the read's start. A failed read keeps the last count.