Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ bazel_coverage_test: failpoint-enable bazel_ci_prepare

bazel_build: bazel_ci_prepare
mkdir -p bin
bazel $(BAZEL_GLOBAL_CONFIG) build --remote_download_minimal $(BAZEL_CMD_CONFIG) \
bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \
//... --//build:with_nogo_flag=true
bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \
//cmd/importer:importer //tidb-server:tidb-server //tidb-server:tidb-server-check --//build:with_nogo_flag=true
Expand Down
14 changes: 11 additions & 3 deletions sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,20 @@ var defaultSysVars = []*SysVar{
}
return strconv.FormatFloat(floatValue, 'f', -1, 64), nil
},
SetGlobal: func(_ context.Context, s *SessionVars, val string) error {
SetGlobal: func(_ context.Context, s *SessionVars, val string) (err error) {
factor := tidbOptFloat64(val, DefTiDBGOGCTunerThreshold)
GOGCTunerThreshold.Store(factor)
memTotal := memory.ServerMemoryLimit.Load()
threshold := float64(memTotal) * factor
gctuner.Tuning(uint64(threshold))
if memTotal == 0 {
memTotal, err = memory.MemTotal()
if err != nil {
return err
}
}
if factor > 0 {
threshold := float64(memTotal) * factor
gctuner.Tuning(uint64(threshold))
}
return nil
},
},
Expand Down