优化内存缓存最大值算法

This commit is contained in:
GoEdgeLab
2023-11-17 19:12:24 +08:00
parent be846218cd
commit 9a46ff0d3f
3 changed files with 51 additions and 12 deletions

View File

@@ -584,8 +584,7 @@ func (this *MemoryStorage) flushItem(key string) {
}
func (this *MemoryStorage) memoryCapacityBytes() int64 {
var maxSystemBytes = int64(utils.SystemMemoryBytes()) / 3 // 1/3 of the system memory
var maxSystemBytes = SharedManager.MaxSystemMemoryBytesPerStorage()
if this.policy == nil {
return maxSystemBytes
}
@@ -612,7 +611,6 @@ func (this *MemoryStorage) memoryCapacityBytes() int64 {
}
}
// 1/4 of the system memory
return maxSystemBytes
}