From af03a271df1cc2051d0590ed84680f4d4f12a421 Mon Sep 17 00:00:00 2001 From: cui Date: Fri, 24 Jul 2026 15:48:40 +0800 Subject: [PATCH] cmd/utils: skip memory-limit sanitize when total memory is unknown (#35407) --- cmd/utils/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 81c408798e..9b64742808 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1793,7 +1793,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { if ctx.IsSet(MemoryLimitFlag.Name) { memLimit := int64(ctx.Int(MemoryLimitFlag.Name)) * 1024 * 1024 - if memLimit > int64(total) { + if total > 0 && memLimit > int64(total) { log.Info("Sanitizing memory limit", "provided(MB)", memLimit/1024/1024, "updated(MB)", total/1024/1024) memLimit = int64(total) }