Skip to content

Commit

Permalink
puller/sorter: remove manual GC settings (#2214) (#2721)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Sep 5, 2021
1 parent 97df39e commit e42cf4c
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 e42cf4c

Please sign in to comment.