good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 292570ad authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub
Browse files

Merge pull request #21028 from karalabe/memfix-32bit-arch

cmd/geth: handle memfixes on 32bit arch with large RAM
parents 933acf33 8f8ff8d6
No related branches found
No related tags found
No related merge requests found
...@@ -314,6 +314,10 @@ func prepare(ctx *cli.Context) { ...@@ -314,6 +314,10 @@ func prepare(ctx *cli.Context) {
// Check https://github.com/elastic/gosigar#supported-platforms // Check https://github.com/elastic/gosigar#supported-platforms
if runtime.GOOS != "openbsd" { if runtime.GOOS != "openbsd" {
if err := mem.Get(); err == nil { if err := mem.Get(); err == nil {
if 32<<(^uintptr(0)>>63) == 32 && mem.Total > 2*1024*1024*1024 {
log.Warn("Lowering memory allowance on 32bit arch", "available", mem.Total/1024/1024, "addressable", 2*1024)
mem.Total = 2 * 1024 * 1024 * 1024
}
allowance := int(mem.Total / 1024 / 1024 / 3) allowance := int(mem.Total / 1024 / 1024 / 3)
if cache := ctx.GlobalInt(utils.CacheFlag.Name); cache > allowance { if cache := ctx.GlobalInt(utils.CacheFlag.Name); cache > allowance {
log.Warn("Sanitizing cache to Go's GC limits", "provided", cache, "updated", allowance) log.Warn("Sanitizing cache to Go's GC limits", "provided", cache, "updated", allowance)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment