Set the runtime system options
and garbage collection parameters.
(If OCAMLRUNPARAM is not set, CAMLRUNPARAM will be used instead.)
This variable must be a sequence of parameter specifications.
A parameter specification is an option letter followed by an =
sign, a decimal number
(or an hexadecimal number prefixed by 0x),
and an optional multiplier. There are
nine options, six of which correspond to the fields of the
control record documented in
Module Gc.
-
b
- (backtrace) Trigger the printing of a stack backtrace
when an uncaught exception aborts the program.
This option takes no argument.
- p
- (parser trace) Turn on debugging support for
ocamlyacc-generated parsers. When this option is on,
the pushdown automaton that executes the parsers prints a
trace of its actions. This option takes no argument.
- s
- (minor_heap_size) Size of the minor heap. (in words)
- i
- (major_heap_increment) Default size increment for the
major heap. (in words)
- o
- (space_overhead) The major GC speed setting.
- O
- (max_overhead) The heap compaction trigger setting.
- v
- (verbose) What GC messages to print to stderr. This
is a sum of values selected from the following:
-
1 (= 0x001)
- Start of major GC cycle.
- 2 (= 0x002)
- Minor collection and major GC slice.
- 4 (= 0x004)
- Growing and shrinking of the heap.
- 8 (= 0x008)
- Resizing of stacks and memory manager tables.
- 16 (= 0x010)
- Heap compaction.
- 32 (= 0x020)
- Change of GC parameters.
- 64 (= 0x040)
- Computation of major GC slice size.
- 128 (= 0x080)
- Calling of finalization functions
- 256 (= 0x100)
- Startup messages (loading the bytecode
executable file, resolving shared libraries).
- l
- (stack_limit) The limit (in words) of the stack size.
- h
- The initial size of the major heap (in words).
The multiplier is k, M, or G, for multiplication by 210,
220, and 230 respectively.
For example, on a 32-bit machine, under bash the command
export OCAMLRUNPARAM='b,s=256k,v=0x015'
tells a subsequent ocamlrun to print backtraces for uncaught exceptions,
set its initial minor heap size to 1 megabyte and
print a message at the start of each major GC cycle, when the heap
size changes, and when compaction is triggered.