Merge commit 'ocaml3102'
[ocaml.git] / man / ocamlrun.m
blob7db888bddfe21d97cb650d00fab6e1c376227a67
1 .TH OCAMLRUN 1
3 .SH NAME
4 ocamlrun \- The Objective Caml bytecode interpreter
6 .SH SYNOPSIS
7 .B ocamlrun
9 .B \-v
11 .I filename argument ...
13 .SH DESCRIPTION
14 The 
15 .BR ocamlrun (1)
16 command executes bytecode files produced by the
17 linking phase of the 
18 .BR ocamlc (1)
19 command.
21 The first non-option argument is taken to be the name of the file
22 containing the executable bytecode. (That file is searched in the
23 executable path as well as in the current directory.) The remaining
24 arguments are passed to the Objective Caml program, in the string array
25 Sys.argv. Element 0 of this array is the name of the
26 bytecode executable file; elements 1 to 
27 .I n
28 are the remaining arguments.
30 In most cases, the bytecode
31 executable files produced by the 
32 .BR ocamlc (1)
33 command are self-executable,
34 and manage to launch the 
35 .BR ocamlrun (1)
36 command on themselves automatically.
38 .SH OPTIONS
40 The following command-line option is recognized by 
41 .BR ocamlrun (1).
43 .TP
44 .B \-v 
45 When set, the memory manager prints verbose messages on standard error
46 to signal garbage collections and heap extensions.
48 .SH ENVIRONMENT VARIABLES
50 The following environment variable are also consulted:
52 .TP
53 .B OCAMLRUNPARAM
54 Set the garbage collection parameters.
55 (If
56 .B OCAMLRUNPARAM
57 is not set,
58 .B CAMLRUNPARAM
59 will be used instead.)
60 This variable must be a sequence of parameter specifications.
61 A parameter specification is an option letter followed by an =
62 sign, a decimal number, and an optional multiplier.  There are seven
63 options:
64 .TP
65 .BR b \ (backtrace)
66 Print a stack backtrace in case of an uncaught exception.
67 .TP
68 .BR s \ (minor_heap_size)
69 Size of the minor heap.
70 .TP
71 .BR i \ (major_heap_increment)
72 Minimum size increment for the major heap.
73 .TP
74 .BR o \ (space_overhead)
75 The major GC speed setting.
76 .TP
77 .BR O \ (max_overhead)
78 The heap compaction trigger setting.
79 .TP
80 .BR l \ (stack_limit)
81 The limit (in words) of the stack size.
82 .TP
83 .BR h
84 The initial size of the major heap (in words).
85 .TP
86 .BR v \ (verbose)
87 What GC messages to print to stderr.  This is a sum of values selected
88 from the following:
89 .TP
90 .BR 1
91 Start of major GC cycle.
92 .TP
93 .BR 2
94 Minor collection and major GC slice.
95 .TP
96 .BR 4
97 Growing and shrinking of the heap.
98 .TP
99 .BR 8
100 Resizing of stacks and memory manager tables.
102 .BR 16
103 Heap compaction.
105 .BR 32
106 Change of GC parameters.
108 .BR 64
109 Computation of major GC slice size.
111 .BR 128
112 Calling of finalisation function.
114 .BR 256
115 Startup messages.
117 The multiplier is
118 .B k
120 .B M
121 , or
122 .B G
123 , for multiplication by 2^10, 2^20, and 2^30 respectively.
124 For example, on a 32-bit machine under bash, the command
125 .B export OCAMLRUNPARAM='s=256k,v=1'
126 tells a subsequent
127 .B ocamlrun
128 to set its initial minor heap size to 1 megabyte and to print
129 a message at the start of each major GC cycle.
132 .B PATH
133 List of directories searched to find the bytecode executable file.
135 .SH SEE ALSO
136 .BR ocamlc (1).
138 .I The Objective Caml user's manual,
139 chapter "Runtime system".