Skip to content

Commit

Permalink
Merge branch 'master' into shrink-grpc-window
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Sep 2, 2021
2 parents c68caa0 + 7ce871a commit a5a48f8
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 a5a48f8

Please sign in to comment.