Add ios memory limit

This commit is contained in:
世界
2023-03-02 13:13:12 +08:00
parent e8802357e1
commit 8151bcfd6b
3 changed files with 12 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
package libbox
import "runtime/debug"
func SetMemoryLimit() {
debug.SetGCPercent(10)
debug.SetMemoryLimit(30 * 1024 * 1024)
}