Kind: KindUint64,
},
{
- Name: "/memory/classes/heap/stacks:bytes",
- Description: "Memory allocated from the heap that is reserved for stack space, whether or not it is currently in-use.",
- Kind: KindUint64,
+ Name: "/memory/classes/heap/stacks:bytes",
+ Description: "Memory allocated from the heap that is reserved for stack space, whether or not it is currently in-use. " +
+ "Currently, this represents all stack memory for goroutines. It also includes all OS thread stacks in non-cgo programs. " +
+ "Note that stacks may be allocated differently in the future, and this may change.",
+ Kind: KindUint64,
},
{
Name: "/memory/classes/heap/unused:bytes",
Kind: KindUint64,
},
{
- Name: "/memory/classes/os-stacks:bytes",
- Description: "Stack memory allocated by the underlying operating system.",
- Kind: KindUint64,
+ Name: "/memory/classes/os-stacks:bytes",
+ Description: "Stack memory allocated by the underlying operating system. " +
+ "In non-cgo programs this metric is currently zero. This may change in the future." +
+ "In cgo programs this metric includes OS thread stacks allocated directly from the OS. " +
+ "Currently, this only accounts for one stack in c-shared and c-archive build modes, " +
+ "and other sources of stacks from the OS are not measured. This too may change in the future.",
+ Kind: KindUint64,
},
{
Name: "/memory/classes/other:bytes",
/memory/classes/heap/stacks:bytes
Memory allocated from the heap that is reserved for stack space,
- whether or not it is currently in-use.
+ whether or not it is currently in-use. Currently, this
+ represents all stack memory for goroutines. It also includes all
+ OS thread stacks in non-cgo programs. Note that stacks may be
+ allocated differently in the future, and this may change.
/memory/classes/heap/unused:bytes
Memory that is reserved for heap objects but is not currently
/memory/classes/os-stacks:bytes
Stack memory allocated by the underlying operating system.
+ In non-cgo programs this metric is currently zero. This may
+ change in the future.In cgo programs this metric includes
+ OS thread stacks allocated directly from the OS. Currently,
+ this only accounts for one stack in c-shared and c-archive build
+ modes, and other sources of stacks from the OS are not measured.
+ This too may change in the future.
/memory/classes/other:bytes
Memory used by execution trace buffers, structures for debugging
// StackSys is bytes of stack memory obtained from the OS.
//
// StackSys is StackInuse, plus any memory obtained directly
- // from the OS for OS thread stacks (which should be minimal).
+ // from the OS for OS thread stacks.
+ //
+ // In non-cgo programs this metric is currently equal to StackInuse
+ // (but this should not be relied upon, and the value may change in
+ // the future).
+ //
+ // In cgo programs this metric includes OS thread stacks allocated
+ // directly from the OS. Currently, this only accounts for one stack in
+ // c-shared and c-archive build modes and other sources of stacks from
+ // the OS (notably, any allocated by C code) are not currently measured.
+ // Note this too may change in the future.
StackSys uint64
// Off-heap memory statistics.