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
9
9
type MemStats struct {
10
10
// General statistics.
11
11
12
+ // Alloc is bytes of allocated heap objects.
13
+ //
14
+ // This is the same as HeapAlloc (see below).
15
+ Alloc uint64
16
+
12
17
// Sys is the total bytes of memory obtained from the OS.
13
18
//
14
19
// Sys is the sum of the XSys fields below. Sys measures the
@@ -18,6 +23,19 @@ type MemStats struct {
18
23
19
24
// Heap memory statistics.
20
25
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
+
21
39
// HeapSys is bytes of heap memory, total.
22
40
//
23
41
// In TinyGo unlike upstream Go, we make no distinction between
You can’t perform that action at this time.
0 commit comments