URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [boehm-gc/] [doc/] [README.environment] - Rev 721
Compare with Previous | Blame | View Log
The garbage collector looks at a number of environment variables which arethen used to affect its operation. These are examined only on Un*x-likeplatforms and win32.GC_INITIAL_HEAP_SIZE=<bytes> - Initial heap size in bytes. May speed upprocess start-up.GC_MAXIMUM_HEAP_SIZE=<bytes> - Maximum collected heap size.GC_LOOP_ON_ABORT - Causes the collector abort routine to enter a tight loop.This may make it easier to debug, such a process, especiallyfor multithreaded platforms that don't produce usable corefiles, or if a core file would be too large. On someplatforms, this also causes SIGSEGV to be caught andresult in an infinite loop in a handler, allowingsimilar debugging techniques.GC_PRINT_STATS - Turn on as much logging as is easily feasible withoutadding signifcant runtime overhead. Doesn't work ifthe collector is built with SMALL_CONFIG. Overriddenby setting GC_quiet. On by default if the collectorwas built without -DSILENT.GC_DUMP_REGULARLY - Generate a GC debugging dump GC_dump() on startupand during every collection. Very verbose. Usefulif you have a bug to report, but please include only thelast complete dump.GC_BACKTRACES=<n> - Generate n random backtraces (for heap profiling) aftereach GC. Collector must have been built withKEEP_BACK_PTRS. This won't generate useful output unlessmost objects in the heap were allocated through debugallocators. This is intended to be only a statisticalsample; individual traces may be erroneous due toconcurrent heap mutation.GC_PRINT_ADDRESS_MAP - Linux only. Dump /proc/self/maps, i.e. various addressmaps for the process, to stderr on every GC. Useful formapping root addresses to source for deciphering leakreports.GC_NPROCS=<n> - Linux w/threads only. Explicitly sets the number of processorsthat the GC should expect to use. Note that setting this to 1when multiple processors are available will preservecorrectness, but may lead to really horrible performance,since the lock implementation will immediately yield withoutfirst spinning.GC_MARKERS=<n> - Linux w/threads and parallel marker only. Set the numberof marker threads. This is normaly set to the number ofprocessors. It is safer to adjust GC_MARKERS than GC_NPROCS,since GC_MARKERS has no impact on the lock implementation.GC_NO_BLACKLIST_WARNING - Prevents the collector from issuingwarnings about allocations of very large blocks.Deprecated. Use GC_LARGE_ALLOC_WARN_INTERVAL instead.GC_LARGE_ALLOC_WARN_INTERVAL=<n> - Print every nth warning about very largeblock allocations, starting with the nth one. Small valuesof n are generally benign, in that a bounded number ofsuch warnings generally indicate at most a bounded leak.For best results it should be set at 1 during testing.Default is 5. Very large numbers effectively disable thewarning.GC_IGNORE_GCJ_INFO - Ignore the type descriptors implicitly supplied byGC_gcj_malloc and friends. This is useful for debuggingdescriptor generation problems, and possibly fortemporarily working around such problems. It forces afully conservative scan of all heap objects exceptthose known to be pointerfree, and may thus have otheradverse effects.GC_PRINT_BACK_HEIGHT - Print max length of chain through unreachable objectsending in a reachable one. If this number remainsbounded, then the program is "GC robust". This ensuresthat a fixed number of misidentified pointers can onlyresult in a bounded space leak. This currently onlyworks if debugging allocation is used throughout.It increases GC space and time requirements appreciably.This feature is still somewhat experimental, and requiresthat the collector have been built with MAKE_BACK_GRAPHdefined. For details, see Boehm, "Bounding Space Usageof Conservative Garbage Collectors", POPL 2001, orhttp://lib.hpl.hp.com/techpubs/2001/HPL-2001-251.html .GC_RETRY_SIGNALS, GC_NO_RETRY_SIGNALS - Try to compensate for lostthread suspend signals in linux_threads.c. On bydefault for GC_OSF1_THREADS, off otherwise. Notethat this does not work around a possible loss ofthread restart signals. This seems to be necessary forsome versions of Tru64. Since we've previously seensimilar issues on some other operating systems, itwas turned into a runtime flag to enable last-minutework-arounds.GC_IGNORE_FB[=<n>] - (Win32 only.) Try to avoid treating a mappedframe buffer as part of the root set. Certain (higher end?)graphics cards seems to result in the graphics memory mappedinto the user address space as writable memory.Unfortunately, there seems to be no systematic way toidentify such memory. Setting the environment variable to ncauses the collector to ignore mappings longer than n MB.The default value of n is currently 15. (This should covera 16 MB graphics card, since the mapping appears to be slightlyshorter than all of graphics memory. It will fail if a dllwrites pointers to collectable objects into a data segmentwhose length is >= 15MB. Empirically that's rare, butcertainly possible.) WARNING: Security sensitive applicationsshould probably disable this feature by settingGC_disallow_ignore_fb, or by building with -DNO_GETENV,since small values could force collection of reachableobjects, which is conceivably a (difficult to exploit)security hole. GC_IGNORE_FB values less than 3 MBare never honored, eliminating this risk for most,but not all, applications. This feature is likely to disappearif/when we find a less disgusting "solution".IN VERSION 6.4 AND LATER, THIS SHOULD BE UNNECESSARY.The following turn on runtime flags that are also program settable. Checkedonly during initialization. We expect that they will usually be set throughother means, but this may help with debugging and testing:GC_ENABLE_INCREMENTAL - Turn on incremental collection at startup. Note that,depending on platform and collector configuration, thismay involve write protecting pieces of the heap totrack modifications. These pieces may include pointerfreeobjects or not. Although this is intended to betransparent, it may cause unintended system call failures.Use with caution.GC_PAUSE_TIME_TARGET - Set the desired garbage collector pause time in msecs.This only has an effect if incremental collection isenabled. If a collection requires appreciably more timethan this, the client will be restarted, and the collectorwill need to do additional work to compensate. Thespecial value "999999" indicates that pause time isunlimited, and the incremental collector will behavecompletely like a simple generational collector. Ifthe collector is configured for parallel marking, andrun on a multiprocessor, incremental collection shouldonly be used with unlimited pause time.GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection. Forces acollection at program termination to detect leaks that wouldotherwise occur after the last GC.GC_ALL_INTERIOR_POINTERS - Turns on GC_all_interior_pointers and thus interiorpointer recognition.GC_DONT_GC - Turns off garbage collection. Use cautiously.
