diff --git a/src/runtime/heapdump.go b/src/runtime/heapdump.go index 362cb7c308..dbeaed9277 100644 --- a/src/runtime/heapdump.go +++ b/src/runtime/heapdump.go @@ -491,10 +491,13 @@ func dumpparams() { var arenaStart, arenaEnd uintptr for i, ha := range mheap_.arenas { if ha != nil { - if arenaStart == 0 { - arenaStart = arenaBase(uint(i)) + base := arenaBase(uint(i)) + if arenaStart == 0 || base < arenaStart { + arenaStart = base + } + if base+heapArenaBytes > arenaEnd { + arenaEnd = base + heapArenaBytes } - arenaEnd = arenaBase(uint(i)) + heapArenaBytes } } dumpint(uint64(arenaStart))