boehm-gc: revert all CACAO-specific modifications; this is now an exact copy of the...
[cacao.git] / src / mm / boehm-gc / doc / README.environment
1 The garbage collector looks at a number of environment variables which are
2 then used to affect its operation.  These are examined only on Un*x-like
3 platforms and win32.
4
5 GC_INITIAL_HEAP_SIZE=<bytes> -  Initial heap size in bytes.  May speed up
6                                 process start-up.
7
8 GC_MAXIMUM_HEAP_SIZE=<bytes> - Maximum collected heap size.
9
10 GC_LOOP_ON_ABORT - Causes the collector abort routine to enter a tight loop.
11                    This may make it easier to debug, such a process, especially
12                    for multithreaded platforms that don't produce usable core
13                    files, or if a core file would be too large.  On some
14                    platforms, this also causes SIGSEGV to be caught and
15                    result in an infinite loop in a handler, allowing
16                    similar debugging techniques.
17
18 GC_PRINT_STATS - Turn on GC logging.  Not functional with -DSMALL_CONFIG.
19
20 GC_LOG_FILE - The name of the log file.  Stderr by default.
21
22 GC_PRINT_VERBOSE_STATS - Turn on even more logging.
23
24 GC_DUMP_REGULARLY - Generate a GC debugging dump GC_dump() on startup
25                     and during every collection.  Very verbose.  Useful
26                     if you have a bug to report, but please include only the
27                     last complete dump.
28
29 GC_BACKTRACES=<n> - Generate n random backtraces (for heap profiling) after
30                     each GC.  Collector must have been built with
31                     KEEP_BACK_PTRS.  This won't generate useful output unless
32                     most objects in the heap were allocated through debug
33                     allocators.  This is intended to be only a statistical
34                     sample;  individual traces may be erroneous due to
35                     concurrent heap mutation.
36
37 GC_PRINT_ADDRESS_MAP - Linux only.  Dump /proc/self/maps, i.e. various address
38                        maps for the process, to stderr on every GC.  Useful for
39                        mapping root addresses to source for deciphering leak
40                        reports.
41
42 GC_NPROCS=<n> - Linux w/threads only.  Explicitly sets the number of processors
43                 that the GC should expect to use.  Note that setting this to 1
44                 when multiple processors are available will preserve
45                 correctness, but may lead to really horrible performance,
46                 since the lock implementation will immediately yield without
47                 first spinning.
48
49 GC_MARKERS=<n> - Only if compiled with PARALLEL_MARK.  Set the number
50                 of marker threads.  This is normally set to the number of
51                 processors.  It is safer to adjust GC_MARKERS than GC_NPROCS,
52                 since GC_MARKERS has no impact on the lock implementation.
53
54 GC_NO_BLACKLIST_WARNING - Prevents the collector from issuing
55                 warnings about allocations of very large blocks.
56                 Deprecated.  Use GC_LARGE_ALLOC_WARN_INTERVAL instead.
57
58 GC_LARGE_ALLOC_WARN_INTERVAL=<n> - Print every nth warning about very large
59                 block allocations, starting with the nth one.  Small values
60                 of n are generally benign, in that a bounded number of
61                 such warnings generally indicate at most a bounded leak.
62                 For best results it should be set at 1 during testing.
63                 Default is 5.  Very large numbers effectively disable the
64                 warning.
65
66 GC_IGNORE_GCJ_INFO - Ignore the type descriptors implicitly supplied by
67                      GC_gcj_malloc and friends.  This is useful for debugging
68                      descriptor generation problems, and possibly for
69                      temporarily working around such problems.  It forces a
70                      fully conservative scan of all heap objects except
71                      those known to be pointerfree, and may thus have other
72                      adverse effects.
73
74 GC_PRINT_BACK_HEIGHT - Print max length of chain through unreachable objects
75                      ending in a reachable one.  If this number remains
76                      bounded, then the program is "GC robust".  This ensures
77                      that a fixed number of misidentified pointers can only
78                      result in a bounded space leak.  This currently only
79                      works if debugging allocation is used throughout.
80                      It increases GC space and time requirements appreciably.
81                      This feature is still somewhat experimental, and requires
82                      that the collector have been built with MAKE_BACK_GRAPH
83                      defined.  For details, see Boehm, "Bounding Space Usage
84                      of Conservative Garbage Collectors", POPL 2001, or
85                      http://lib.hpl.hp.com/techpubs/2001/HPL-2001-251.html .
86
87 GC_RETRY_SIGNALS, GC_NO_RETRY_SIGNALS - Try to compensate for lost
88                      thread suspend signals in linux_threads.c.  On by
89                      default for GC_OSF1_THREADS, off otherwise.  Note 
90                      that this does not work around a possible loss of
91                      thread restart signals.  This seems to be necessary for
92                      some versions of Tru64.  Since we've previously seen
93                      similar issues on some other operating systems, it
94                      was turned into a runtime flag to enable last-minute
95                      work-arounds.
96
97 GC_USE_GETWRITEWATCH=<n> - Only if MPROTECT_VDB and GWW_VDB are both defined
98                      (Win32 only).  Explicitly specify which strategy of
99                      keeping track of dirtied pages should be used.
100                      If n=0 then GetWriteWatch() is not used (falling back to
101                      protecting pages and catching memory faults strategy)
102                      else the collector tries to use GetWriteWatch-based
103                      strategy (GWW_VDB) first if available.
104
105 GC_DISABLE_INCREMENTAL - Ignore runtime requests to enable incremental GC.
106                      Useful for debugging.
107
108 The following turn on runtime flags that are also program settable.  Checked
109 only during initialization.  We expect that they will usually be set through
110 other means, but this may help with debugging and testing:
111
112 GC_ENABLE_INCREMENTAL - Turn on incremental collection at startup.  Note that,
113                      depending on platform and collector configuration, this
114                      may involve write protecting pieces of the heap to
115                      track modifications.  These pieces may include pointerfree
116                      objects or not.  Although this is intended to be
117                      transparent, it may cause unintended system call failures.
118                      Use with caution.
119
120 GC_PAUSE_TIME_TARGET - Set the desired garbage collector pause time in msecs.
121                      This only has an effect if incremental collection is
122                      enabled.  If a collection requires appreciably more time
123                      than this, the client will be restarted, and the collector
124                      will need to do additional work to compensate.  The
125                      special value "999999" indicates that pause time is
126                      unlimited, and the incremental collector will behave
127                      completely like a simple generational collector.  If
128                      the collector is configured for parallel marking, and
129                      run on a multiprocessor, incremental collection should
130                      only be used with unlimited pause time.
131
132 GC_FULL_FREQUENCY - Set the desired number of partial collections between full
133                   collections.  Matters only if GC_incremental is set.
134
135 GC_FREE_SPACE_DIVISOR - Set GC_free_space_divisor to the indicated value.
136                       Setting it to larger values decreases space consumption
137                       and increases GC frequency.
138
139 GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection.  Forces a
140                collection at program termination to detect leaks that would
141                otherwise occur after the last GC.
142
143 GC_ALL_INTERIOR_POINTERS - Turns on GC_all_interior_pointers and thus interior
144                            pointer recognition.
145
146 GC_DONT_GC - Turns off garbage collection.  Use cautiously.
147
148 GC_TRACE=addr - Intended for collector debugging.  Requires that the collector
149                 have been built with ENABLE_TRACE defined.  Causes the debugger
150                 to log information about the tracing of address ranges
151                 containing addr.  Typically addr is the address that contains
152                 a pointer to an object that mysteriously failed to get marked.
153                 Addr must be specified as a hexadecimal integer.