mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
cmd/utils: add warning msg
This commit is contained in:
parent
ea50f0b1b0
commit
b644b32190
1 changed files with 9 additions and 4 deletions
|
|
@ -1775,19 +1775,24 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
|||
}
|
||||
|
||||
// Setting go runtime settings
|
||||
gcPercent := ctx.Int(GOGCFlag.Name)
|
||||
if ctx.IsSet(GOGCFlag.Name) {
|
||||
gcPercent := ctx.Int(GOGCFlag.Name)
|
||||
log.Info("Sanitizing Go's GC trigger", "percent", gcPercent)
|
||||
godebug.SetGCPercent(gcPercent)
|
||||
}
|
||||
godebug.SetGCPercent(gcPercent)
|
||||
|
||||
if ctx.IsSet(MemoryLimitFlag.Name) {
|
||||
memLimit := int64(ctx.Int(MemoryLimitFlag.Name)) * 1024 * 1024
|
||||
if memLimit > int64(total) {
|
||||
log.Info("Sanitizing memory limit", "provided(MB)", memLimit/1024/1024, "updated(MB)", total/1024/1024)
|
||||
memLimit = int64(total)
|
||||
}
|
||||
log.Info("Setting Go memory limit", "MB", memLimit/1024/1024)
|
||||
godebug.SetMemoryLimit(memLimit)
|
||||
if memLimit < 0 {
|
||||
log.Warn("Ignoring negative Go memory limit")
|
||||
} else {
|
||||
log.Info("Setting Go memory limit", "MB", memLimit/1024/1024)
|
||||
godebug.SetMemoryLimit(memLimit)
|
||||
}
|
||||
}
|
||||
|
||||
if ctx.IsSet(SyncTargetFlag.Name) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue