Skip to content

Commit 01466fa

Browse files
committed
Set GC percent to 20 instead of 100 by default
1 parent 80b9739 commit 01466fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/goofys.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ func newGoofys(ctx context.Context, bucket string, flags *FlagStorage,
255255
Mtime: now,
256256
}
257257

258+
if os.Getenv("GOGC") == "" {
259+
// Set garbage collection ratio to 20 instead of 100 by default.
260+
debug.SetGCPercent(20)
261+
}
262+
258263
fs.bufferPool = NewBufferPool(int64(flags.MemoryLimit), uint64(flags.GCInterval) << 20)
259264
fs.bufferPool.FreeSomeCleanBuffers = func(size int64) (int64, bool) {
260265
return fs.FreeSomeCleanBuffers(size)

0 commit comments

Comments
 (0)