File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ package runtime
99type MemStats struct {
1010 // General statistics.
1111
12+ // Alloc is bytes of allocated heap objects.
13+ //
14+ // This is the same as HeapAlloc (see below).
15+ Alloc uint64
16+
1217 // Sys is the total bytes of memory obtained from the OS.
1318 //
1419 // Sys is the sum of the XSys fields below. Sys measures the
@@ -18,6 +23,19 @@ type MemStats struct {
1823
1924 // Heap memory statistics.
2025
26+ // HeapAlloc is bytes of allocated heap objects.
27+ //
28+ // "Allocated" heap objects include all reachable objects, as
29+ // well as unreachable objects that the garbage collector has
30+ // not yet freed. Specifically, HeapAlloc increases as heap
31+ // objects are allocated and decreases as the heap is swept
32+ // and unreachable objects are freed. Sweeping occurs
33+ // incrementally between GC cycles, so these two processes
34+ // occur simultaneously, and as a result HeapAlloc tends to
35+ // change smoothly (in contrast with the sawtooth that is
36+ // typical of stop-the-world garbage collectors).
37+ HeapAlloc uint64
38+
2139 // HeapSys is bytes of heap memory, total.
2240 //
2341 // In TinyGo unlike upstream Go, we make no distinction between
You can’t perform that action at this time.
0 commit comments