compute: func(in *statAggregate, out *metricValue) {
out.kind = metricKindUint64
out.scalar = uint64(in.heapStats.committed - in.heapStats.inHeap -
- in.heapStats.inStacks - in.heapStats.inWorkBufs -
- in.heapStats.inPtrScalarBits)
+ in.heapStats.inStacks - in.heapStats.inWorkBufs)
},
},
"/memory/classes/heap/objects:bytes": {
deps: makeStatDepSet(heapStatsDep, sysStatsDep),
compute: func(in *statAggregate, out *metricValue) {
out.kind = metricKindUint64
- out.scalar = uint64(in.heapStats.inWorkBufs+in.heapStats.inPtrScalarBits) + in.sysStats.gcMiscSys
+ out.scalar = uint64(in.heapStats.inWorkBufs) + in.sysStats.gcMiscSys
},
},
"/memory/classes/os-stacks:bytes": {
type spanAllocType uint8
const (
- spanAllocHeap spanAllocType = iota // heap span
- spanAllocStack // stack span
- spanAllocPtrScalarBits // unrolled GC prog bitmap span
- spanAllocWorkBuf // work buf span
+ spanAllocHeap spanAllocType = iota // heap span
+ spanAllocStack // stack span
+ spanAllocWorkBuf // work buf span
)
// manual returns true if the span allocation is manually managed.
atomic.Xaddint64(&stats.inHeap, int64(nbytes))
case spanAllocStack:
atomic.Xaddint64(&stats.inStacks, int64(nbytes))
- case spanAllocPtrScalarBits:
- atomic.Xaddint64(&stats.inPtrScalarBits, int64(nbytes))
case spanAllocWorkBuf:
atomic.Xaddint64(&stats.inWorkBufs, int64(nbytes))
}
atomic.Xaddint64(&stats.inHeap, -int64(nbytes))
case spanAllocStack:
atomic.Xaddint64(&stats.inStacks, -int64(nbytes))
- case spanAllocPtrScalarBits:
- atomic.Xaddint64(&stats.inPtrScalarBits, -int64(nbytes))
case spanAllocWorkBuf:
atomic.Xaddint64(&stats.inWorkBufs, -int64(nbytes))
}
stackInUse := uint64(consStats.inStacks)
gcWorkBufInUse := uint64(consStats.inWorkBufs)
- gcProgPtrScalarBitsInUse := uint64(consStats.inPtrScalarBits)
totalMapped := gcController.heapInUse.load() + gcController.heapFree.load() + gcController.heapReleased.load() +
memstats.stacks_sys.load() + memstats.mspan_sys.load() + memstats.mcache_sys.load() +
memstats.buckhash_sys.load() + memstats.gcMiscSys.load() + memstats.other_sys.load() +
- stackInUse + gcWorkBufInUse + gcProgPtrScalarBitsInUse
+ stackInUse + gcWorkBufInUse
heapGoal := gcController.heapGoal()
//
// * memstats.heapInUse == inHeap
// * memstats.heapReleased == released
- // * memstats.heapInUse + memstats.heapFree == committed - inStacks - inWorkBufs - inPtrScalarBits
+ // * memstats.heapInUse + memstats.heapFree == committed - inStacks - inWorkBufs
// * memstats.totalAlloc == totalAlloc
// * memstats.totalFree == totalFree
//
throw("heapReleased and consistent stats are not equal")
}
heapRetained := gcController.heapInUse.load() + gcController.heapFree.load()
- consRetained := uint64(consStats.committed - consStats.inStacks - consStats.inWorkBufs - consStats.inPtrScalarBits)
+ consRetained := uint64(consStats.committed - consStats.inStacks - consStats.inWorkBufs)
if heapRetained != consRetained {
print("runtime: global value=", heapRetained, "\n")
print("runtime: consistent value=", consRetained, "\n")
//
// or
//
- // HeapSys = sys - stacks_inuse - gcWorkBufInUse - gcProgPtrScalarBitsInUse
- // HeapIdle = sys - stacks_inuse - gcWorkBufInUse - gcProgPtrScalarBitsInUse - heapInUse
+ // HeapSys = sys - stacks_inuse - gcWorkBufInUse
+ // HeapIdle = sys - stacks_inuse - gcWorkBufInUse - heapInUse
//
// => HeapIdle = HeapSys - heapInUse = heapFree + heapReleased
stats.HeapIdle = gcController.heapFree.load() + gcController.heapReleased.load()
// MemStats defines GCSys as an aggregate of all memory related
// to the memory management system, but we track this memory
// at a more granular level in the runtime.
- stats.GCSys = memstats.gcMiscSys.load() + gcWorkBufInUse + gcProgPtrScalarBitsInUse
+ stats.GCSys = memstats.gcMiscSys.load() + gcWorkBufInUse
stats.OtherSys = memstats.other_sys.load()
stats.NextGC = heapGoal
stats.LastGC = memstats.last_gc_unix
// consistent with one another.
type heapStatsDelta struct {
// Memory stats.
- committed int64 // byte delta of memory committed
- released int64 // byte delta of released memory generated
- inHeap int64 // byte delta of memory placed in the heap
- inStacks int64 // byte delta of memory reserved for stacks
- inWorkBufs int64 // byte delta of memory reserved for work bufs
- inPtrScalarBits int64 // byte delta of memory reserved for unrolled GC prog bits
+ committed int64 // byte delta of memory committed
+ released int64 // byte delta of released memory generated
+ inHeap int64 // byte delta of memory placed in the heap
+ inStacks int64 // byte delta of memory reserved for stacks
+ inWorkBufs int64 // byte delta of memory reserved for work bufs
// Allocator stats.
//
a.inHeap += b.inHeap
a.inStacks += b.inStacks
a.inWorkBufs += b.inWorkBufs
- a.inPtrScalarBits += b.inPtrScalarBits
a.tinyAllocCount += b.tinyAllocCount
a.largeAlloc += b.largeAlloc