Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Sep 14, 2022
1 parent ea05d04 commit b198b25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,6 @@ const (
TiDBServerMemoryQuota = "tidb_server_memory_quota"
// TiDBServerMemoryLimitSessMinSize indicates the minimum memory usage of the session that can be controlled.
TiDBServerMemoryLimitSessMinSize = "tidb_server_memory_limit_sess_min_size"

)

// TiDB intentional limits
Expand Down
3 changes: 2 additions & 1 deletion util/expensivequery/server_memory_quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
)

type serverMemoryQuota struct {
sessionID uint64
sqlStartTime time.Time
sessionID uint64
}

func (s *serverMemoryQuota) CheckQuotaAndKill(bt uint64, sm util.SessionManager) {
Expand All @@ -36,6 +36,7 @@ func (s *serverMemoryQuota) CheckQuotaAndKill(bt uint64, sm util.SessionManager)
}
s.sessionID = 0
s.sqlStartTime = time.Time{}
//nolint: all_revive,revive
runtime.GC()
}

Expand Down
4 changes: 2 additions & 2 deletions util/memory/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ type Tracker struct {
bytesConsumed int64 // Consumed bytes.
bytesReleased int64 // Released bytes.
maxConsumed atomicutil.Int64 // max number of bytes consumed during execution.
isGlobal bool // isGlobal indicates whether this tracker is global tracker
IsSession bool // IsSession indicates whether this tracker is bound for session
SessionID uint64 // SessionID indicates the sessionID the tracker is bound.
IsKilled atomic.Bool // IsKilled indicates whether this session is killed because OOM
IsSession bool // IsSession indicates whether this tracker is bound for session
isGlobal bool // isGlobal indicates whether this tracker is global tracker
}

type actionMu struct {
Expand Down

0 comments on commit b198b25

Please sign in to comment.