MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / MaxSystemMemoryBytesPerStorage

Method MaxSystemMemoryBytesPerStorage

internal/caches/manager.go:296–307  ·  view source on GitHub ↗

MaxSystemMemoryBytesPerStorage 计算单个策略能使用的系统最大内存

()

Source from the content-addressed store, hash-verified

294
295// MaxSystemMemoryBytesPerStorage 计算单个策略能使用的系统最大内存
296func (this *Manager) MaxSystemMemoryBytesPerStorage() int64 {
297 var count = this.CountMemoryStorages
298 if count < 1 {
299 count = 1
300 }
301
302 var resultBytes = int64(memutils.SystemMemoryBytes()) / 3 / int64(count) // 1/3 of the system memory
303 if resultBytes < 1<<30 {
304 resultBytes = 1 << 30
305 }
306 return resultBytes
307}

Calls

no outgoing calls