package
6.7.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev

# Functions

BytesToString converts the memory consumption to a readable string.
ForceReadMemStats is to force read memory stats.
FormatBytes uses to format bytes, this function will prune precision before format bytes.
GetMemTotalIgnoreErr returns the total amount of RAM on this system/container.
InitTracker initializes a memory tracker.
InstanceMemUsed returns the memory usage of this TiDB server.
MemTotalCGroup returns the total amount of RAM on this system in container environment.
MemTotalNormal returns the total amount of RAM on this system in non-container environment.
MemUsedCGroup returns the total used amount of RAM on this system in container environment.
MemUsedNormal returns the total used amount of RAM on this system in non-container environment.
NewGlobalTracker creates a global tracker, its isGlobal is default as true.
NewTracker creates a memory tracker.
ReadMemStats read the mem stats from runtime.ReadMemStats.

# Constants

Default OOM Action priority.
Default OOM Action priority.
Default OOM Action priority.
Default OOM Action priority.
LabelForAnalyzeMemory represents the label of the memory of each analyze job.
LabelForApplyCache represents the label of the apply cache.
LabelForBindCache represents the label of the bind cache.
LabelForBuildSideResult represents the label of the BuildSideResult.
LabelForChunkList represents the label of the chunk list.
LabelForChunkListInDisk represents the label of the chunk list in disk.
LabelForCoprocessor represents the label of the coprocessor.
LabelForCTEStorage represents the label of CTE storage.
LabelForGlobalAnalyzeMemory represents the label of the global memory of all analyze jobs.
LabelForGlobalMemory represents the label of the Global Memory.
LabelForGlobalSimpleLRUCache represents the label of the Global SimpleLRUCache.
LabelForGlobalStorage represents the label of the Global Storage.
LabelForIndexJoinInnerWorker represents the label of IndexJoin InnerWorker.
LabelForIndexJoinOuterWorker represents the label of IndexJoin OuterWorker.
LabelForIndexWorker represents the label of the index worker.
LabelForInnerList represents the label of the inner list.
LabelForInnerTable represents the label of the inner table.
LabelForMemDB represents the label of the MemDB.
LabelForNonTransactionalDML represents the label of the non-transactional DML.
LabelForOuterList represents the label of the outer list.
LabelForOuterTable represents the label of the outer table.
LabelForPreparedPlanCache represents the label of the prepared plan cache memory usage.
LabelForRowChunks represents the label of the row chunks.
LabelForRowContainer represents the label of the row container.
LabelForSession represents the label of a session.
LabelForSimpleTask represents the label of the simple task.
LabelForSQLText represents the label of the SQL Text.
LabelForStatsCache represents the label of the stats cache.
PanicMemoryExceed represents the panic message when out of memory quota.
ReadMemInterval controls the interval to read memory stats.
100MB.

# Variables

EnableGCAwareMemoryTrack is used to turn on/off the GC-aware memory track.
Process global variables for memory limit.
Process global variables for memory limit.
MemTotal returns the total amount of RAM on this system.
MemUsageTop1Tracker record the use memory top1 session's tracker for kill.
MemUsed returns the total used amount of RAM on this system.
MetricsTypes is used to get label for metrics string[0] is LblModule, string[1] is heap-in-use type, string[2] is released type.
Process global variables for memory limit.
Process global variables for memory limit.
Process global variables for memory limit.
Process global variables for memory limit.
Process global variables for memory limit.

# Structs

BaseOOMAction manages the fallback action for all Action.
LogOnExceed logs a warning only once when memory usage exceeds memory quota.
PanicOnExceed panics when memory usage exceeds memory quota.
Tracker is used to track the memory usage during query execution.

# Interfaces

ActionOnExceed is the action taken when memory usage exceeds memory quota.