mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: break down memstats.gc_sys
This change breaks apart gc_sys into three distinct pieces. Two of those pieces are pieces which come from heap_sys since they're allocated from the page heap. The rest comes from memory mapped from e.g. persistentalloc which better fits the purpose of a sysMemStat. Also, rename gc_sys to gcMiscSys. Change-Id: I098789170052511e7b31edbcdc9a53e5c24573f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/246973 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
39e335ac06
commit
ad863ba32a
7 changed files with 39 additions and 27 deletions
|
|
@ -743,9 +743,9 @@ mapped:
|
|||
throw("arena already initialized")
|
||||
}
|
||||
var r *heapArena
|
||||
r = (*heapArena)(h.heapArenaAlloc.alloc(unsafe.Sizeof(*r), sys.PtrSize, &memstats.gc_sys))
|
||||
r = (*heapArena)(h.heapArenaAlloc.alloc(unsafe.Sizeof(*r), sys.PtrSize, &memstats.gcMiscSys))
|
||||
if r == nil {
|
||||
r = (*heapArena)(persistentalloc(unsafe.Sizeof(*r), sys.PtrSize, &memstats.gc_sys))
|
||||
r = (*heapArena)(persistentalloc(unsafe.Sizeof(*r), sys.PtrSize, &memstats.gcMiscSys))
|
||||
if r == nil {
|
||||
throw("out of memory allocating heap arena metadata")
|
||||
}
|
||||
|
|
@ -757,7 +757,7 @@ mapped:
|
|||
if size == 0 {
|
||||
size = physPageSize
|
||||
}
|
||||
newArray := (*notInHeap)(persistentalloc(size, sys.PtrSize, &memstats.gc_sys))
|
||||
newArray := (*notInHeap)(persistentalloc(size, sys.PtrSize, &memstats.gcMiscSys))
|
||||
if newArray == nil {
|
||||
throw("out of memory allocating allArenas")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue