mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-27 11:01:28 +00:00
19 lines
340 B
Go
19 lines
340 B
Go
//go:build darwin
|
|
|
|
package libbox
|
|
|
|
import (
|
|
runtimeDebug "runtime/debug"
|
|
|
|
"github.com/sagernet/sing-box/common/dialer/conntrack"
|
|
)
|
|
|
|
const memoryLimit = 30 * 1024 * 1024
|
|
|
|
func SetMemoryLimit() {
|
|
runtimeDebug.SetGCPercent(10)
|
|
runtimeDebug.SetMemoryLimit(memoryLimit)
|
|
conntrack.KillerEnabled = true
|
|
conntrack.MemoryLimit = memoryLimit
|
|
}
|