@@ -21,8 +21,8 @@ is GOGC=100. Setting GOGC=off disables the garbage collector entirely.
21
21
The runtime/debug package's SetGCPercent function allows changing this
22
22
percentage at run time. See http://golang.org/pkg/runtime/debug/#SetGCPercent.
23
23
24
- The GODEBUG variable controls debug output from the runtime. GODEBUG value is
25
- a comma-separated list of name=val pairs. Supported names are :
24
+ The GODEBUG variable controls debugging variables within the runtime.
25
+ It is a comma-separated list of name=val pairs setting these named variables :
26
26
27
27
allocfreetrace: setting allocfreetrace=1 causes every allocation to be
28
28
profiled and a stack trace printed on each object's allocation and free.
@@ -31,23 +31,46 @@ a comma-separated list of name=val pairs. Supported names are:
31
31
where each object is allocated on a unique page and addresses are
32
32
never recycled.
33
33
34
+ gccheckmark: setting gccheckmark=1 enables verification of the
35
+ garbage collector's concurrent mark phase by performing a
36
+ second mark pass while the world is stopped. If the second
37
+ pass finds a reachable object that was not found by concurrent
38
+ mark, the garbage collector will panic.
39
+
40
+ gcpacertrace: setting gcpacertrace=1 causes the garbage collector to
41
+ print information about the internal state of the concurrent pacer.
42
+
43
+ gcshrinkstackoff: setting gcshrinkstackoff=1 disables moving goroutines
44
+ onto smaller stacks. In this mode, a goroutine's stack can only grow.
45
+
46
+ gcstackbarrieroff: setting gcstackbarrieroff=1 disables the use of stack barriers
47
+ that allow the garbage collector to avoid repeating a stack scan during the
48
+ mark termination phase.
49
+
50
+ gcstoptheworld: setting gcstoptheworld=1 disables concurrent garbage collection,
51
+ making every garbage collection a stop-the-world event. Setting gcstoptheworld=2
52
+ also disables concurrent sweeping after the garbage collection finishes.
53
+
34
54
gctrace: setting gctrace=1 causes the garbage collector to emit a single line to standard
35
55
error at each collection, summarizing the amount of memory collected and the
36
56
length of the pause. Setting gctrace=2 emits the same summary but also
37
57
repeats each collection.
38
58
39
- gcdead: setting gcdead=1 causes the garbage collector to clobber all stack slots
40
- that it thinks are dead.
59
+ memprofilerate: setting memprofilerate=X will update the value of runtime.MemProfileRate.
60
+ When set to 0 memory profiling is disabled. Refer to the description of
61
+ MemProfileRate for the default value.
41
62
42
63
invalidptr: defaults to invalidptr=1, causing the garbage collector and stack
43
64
copier to crash the program if an invalid pointer value (for example, 1)
44
65
is found in a pointer-typed location. Setting invalidptr=0 disables this check.
45
66
This should only be used as a temporary workaround to diagnose buggy code.
46
67
The real fix is to not store integers in pointer-typed locations.
47
68
48
- memprofilerate: setting memprofilerate=X will update the value of runtime.MemProfileRate.
49
- When set to 0 memory profiling is disabled. Refer to the description of
50
- MemProfileRate for the default value.
69
+ sbrk: setting sbrk=1 replaces the memory allocator and garbage collector
70
+ with a trivial allocator that obtains memory from the operating system and
71
+ never reclaims any memory.
72
+
73
+ scavenge: scavenge=1 enables debugging mode of heap scavenger.
51
74
52
75
scheddetail: setting schedtrace=X and scheddetail=1 causes the scheduler to emit
53
76
detailed multiline info every X milliseconds, describing state of the scheduler,
@@ -56,14 +79,6 @@ a comma-separated list of name=val pairs. Supported names are:
56
79
schedtrace: setting schedtrace=X causes the scheduler to emit a single line to standard
57
80
error every X milliseconds, summarizing the scheduler state.
58
81
59
- scavenge: scavenge=1 enables debugging mode of heap scavenger.
60
-
61
- gccheckmark: setting gccheckmark=1 enables verification of the
62
- garbage collector's concurrent mark phase by performing a
63
- second mark pass while the world is stopped. If the second
64
- pass finds a reachable object that was not found by concurrent
65
- mark, the garbage collector will panic.
66
-
67
82
The GOMAXPROCS variable limits the number of operating system threads that
68
83
can execute user-level Go code simultaneously. There is no limit to the number of threads
69
84
that can be blocked in system calls on behalf of Go code; those do not count against
0 commit comments