mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-03 15:00:26 +08:00
优化内存缓存最大值算法
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user