Skip to content

Commit

Permalink
Set GC percent to 20 instead of 100 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Apr 5, 2023
1 parent 80b9739 commit 01466fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/goofys.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ func newGoofys(ctx context.Context, bucket string, flags *FlagStorage,
Mtime: now,
}

if os.Getenv("GOGC") == "" {
// Set garbage collection ratio to 20 instead of 100 by default.
debug.SetGCPercent(20)
}

fs.bufferPool = NewBufferPool(int64(flags.MemoryLimit), uint64(flags.GCInterval) << 20)
fs.bufferPool.FreeSomeCleanBuffers = func(size int64) (int64, bool) {
return fs.FreeSomeCleanBuffers(size)
Expand Down

0 comments on commit 01466fa

Please sign in to comment.