README.environment 10 KB

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