Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puller/sorter: remove manual GC settings (#2214) #2720

Merged
Merged
Changes from 2 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
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