OCAMLRUN(1) | General Commands Manual | OCAMLRUN(1) |
ocamlrun - The OCaml bytecode interpreter
ocamlrun [ options ] filename argument ...
The ocamlrun(1) command executes bytecode files produced by the linking phase of the ocamlc(1) command.
The first non-option argument is taken to be the name of the file containing the executable bytecode. (That file is searched in the executable path as well as in the current directory.) The remaining arguments are passed to the OCaml program, in the string array Sys.argv. Element 0 of this array is the name of the bytecode executable file; elements 1 to n are the remaining arguments.
In most cases, the bytecode executable files produced by the ocamlc(1) command are self-executable, and manage to launch the ocamlrun(1) command on themselves automatically.
The following command-line options are recognized by ocamlrun(1).
The following environment variable are also consulted:
0x001 Start of major GC cycle.
0x002 Minor collection and major GC slice.
0x004 Growing and shrinking of the heap.
0x008 Resizing of stacks and memory manager tables.
0x010 Heap compaction.
0x020 Change of GC parameters.
0x040 Computation of major GC slice size.
0x080 Calling of finalisation functions.
0x100 Startup messages (loading the bytecode executable file, resolving shared libraries).
0x200 Computation of compaction-triggering condition.
0x400 Output GC statistics at program exit, in the same format as Gc.print_stat.
The multiplier is k, M, or G, for multiplication by 2^10, 2^20, and 2^30 respectively.
If the option letter is not recognized, the whole parameter is ignored; if the equal sign or the number is missing, the value is taken as 1; if the multiplier is not recognized, it is ignored.
For example, on a 32-bit machine under bash, the command export OCAMLRUNPARAM='s=256k,v=1' tells a subsequent ocamlrun to set its initial minor heap size to 1 megabyte and to print a message at the start of each major GC cycle.
ocamlc(1).
The OCaml user's manual, chapter "Runtime system".