Skip to content

Commit

Permalink
puller/sorter: remove manual GC setttings
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Shen <overvenus@gmail.com>
  • Loading branch information
overvenus authored and ti-chi-bot committed Sep 2, 2021
1 parent 99091db commit ba2860b
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions cdc/puller/sorter/backend_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
"os"
"path/filepath"
"reflect"
"runtime"
"runtime/debug"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -133,18 +131,6 @@ func newBackEndPool(dir string, captureAddr string) (*backEndPool, error) {
atomic.StoreInt32(&ret.memPressure, int32(memPressure))
}

if memPressure := ret.memoryPressure(); memPressure > 50 {
log.Debug("unified sorter: high memory pressure", zap.Int32("memPressure", memPressure),
zap.Int64("usedBySorter", ret.sorterMemoryUsage()))
// Increase GC frequency to avoid unnecessary OOMs
debug.SetGCPercent(10)
if memPressure > 80 {
runtime.GC()
}
} else {
debug.SetGCPercent(50)
}

// garbage collect temporary files in batches
freedCount := 0
for i := range ret.cache {
Expand Down

0 comments on commit ba2860b

Please sign in to comment.