Fix debug.SetMemoryLimit usage

This commit is contained in:
世界 2023-09-20 22:01:58 +08:00
parent ae8187ed15
commit 678f6ef72f
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -27,7 +27,7 @@ func applyDebugOptions(options option.DebugOptions) {
debug.SetTraceback(options.TraceBack)
}
if options.MemoryLimit != 0 {
debug.SetMemoryLimit(int64(options.MemoryLimit))
debug.SetMemoryLimit(int64(float64(options.MemoryLimit) / 1.5))
conntrack.MemoryLimit = uint64(options.MemoryLimit)
}
if options.OOMKiller != nil {