package
9.0.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.
InitMemoryHook initializes the memory hook.
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.
NewActionWithPriority wraps the action with a new priority.
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
DefCursorFetchSpillPriority is higher than normal disk spill, because it can release much more memory in the future.
Default OOM Action priority.
1GB.
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.
LabelForChunkDataInDiskByChunks represents the label of the chunk list in disk.
LabelForChunkDataInDiskByRows represents the label of the chunk list in disk.
LabelForChunkList represents the label of the chunk list.
LabelForCoprocessor represents the label of the coprocessor.
LabelForCTEStorage represents the label of CTE storage.
LabelForCursorFetch represents the label of the execution of cursor fetch.
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.
LabelForHashTableInHashJoinV2 represents the label of the hash join v2's hash table.
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.
LabelForSortPartition represents the label of the sort partition.
LabelForSQLText represents the label of the SQL Text.
LabelForStatsCache represents the label of the stats cache.
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.