减少Daemon使用的内存

This commit is contained in:
GoEdgeLab
2022-07-26 09:41:43 +08:00
parent 222631bdb9
commit 99b7f77410
12 changed files with 51 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
package compressions
import (
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
"github.com/TeaOSLab/EdgeNode/internal/utils"
"io"
)
@@ -10,6 +11,10 @@ import (
var sharedDeflateReaderPool *ReaderPool
func init() {
if teaconst.IsDaemon {
return
}
var maxSize = utils.SystemMemoryGB() * 256
if maxSize == 0 {
maxSize = 256