We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81cb9a5 commit 86709e9Copy full SHA for 86709e9
pkg/statistics/handle/cache/internal/lfu/lfu_cache.go
@@ -75,14 +75,14 @@ func NewLFU(totalMemCost int64) (*LFU, error) {
75
}
76
77
// 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.
+// When the total memory cost is 0, the memory cost is set to 20% of the total memory.
79
func adjustMemCost(totalMemCost int64) (result int64, err error) {
80
if totalMemCost == 0 {
81
memTotal, err := memory.MemTotal()
82
if err != nil {
83
return 0, err
84
85
- return int64(memTotal / 2), nil
+ return int64(memTotal * 20 / 100), nil
86
87
return totalMemCost, nil
88
0 commit comments