Skip to content

Commit a8977c1

Browse files
authored
statistics: stats cache set default quota as 20% (#58013) (#58817)
close #58014
1 parent 587a810 commit a8977c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/statistics/handle/cache/internal/lfu/lfu_cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ func NewLFU(totalMemCost int64) (*LFU, error) {
7575
}
7676

7777
// adjustMemCost adjusts the memory cost according to the total memory cost.
78-
// When the total memory cost is 0, the memory cost is set to half of the total memory.
78+
// When the total memory cost is 0, the memory cost is set to 20% of the total memory.
7979
func adjustMemCost(totalMemCost int64) (result int64, err error) {
8080
if totalMemCost == 0 {
8181
memTotal, err := memory.MemTotal()
8282
if err != nil {
8383
return 0, err
8484
}
85-
return int64(memTotal / 2), nil
85+
return int64(memTotal * 20 / 100), nil
8686
}
8787
return totalMemCost, nil
8888
}

0 commit comments

Comments
 (0)