Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented M, m, n, w, W, t, c and H options of OCAMLRUNPARAM, Fixes #8697 #10666

Merged
merged 15 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -122,6 +122,10 @@ Working version
- #10605: manual, name few css classes to ease styling and maintainability.
(Florian Angeletti, review by Wiktor Kuchta and Gabriel Scherer)

- #8697, #10666: add M, m, n options of the OCAMLRUNPARAM to manual and man page
for ocamlrun command line options
(Dong An and Anukriti Kumar, review by David Allsopp, Gabriel Scherer)

kirisky marked this conversation as resolved.
Show resolved Hide resolved
### Compiler user-interface and warnings:

- #10328: Give more precise error when disambiguation could not possibly work.
Expand Down
32 changes: 31 additions & 1 deletion man/ocamlrun.m
Expand Up @@ -74,11 +74,22 @@ flag in the OCAMLRUNPARAM environment variable (see below).
.I dir
for dynamically-loaded libraries, in addition to the standard search path.
.TP
.B \-m
Print the magic number of the bytecode executable given as argument and
exit.
kirisky marked this conversation as resolved.
Show resolved Hide resolved
.TP
.B \-M
Print the magic number expected for bytecode executables by this version
of the runtime and exit.
.TP
.B \-p
Print the names of the primitives known to this version of
.BR ocamlrun (1)
and exit.
.TP
.B \-t
Increments the trace level for the debug runtime (ignored otherwise).
kirisky marked this conversation as resolved.
Show resolved Hide resolved
.TP
.B \-v
Direct the memory manager to print verbose messages on standard error.
This is equivalent to setting
Expand Down Expand Up @@ -125,13 +136,17 @@ in the OCAMLRUNPARAM environment variable (see below).
record documented in
.IR "The OCaml user's manual",
chapter "Standard Library", section "Gc".
\" FIXME missing: c, H, t, w, W see MPR#7870
.TP
.B b
Trigger the printing of a stack backtrace
when an uncaught exception aborts the program.
This option takes no argument.
.TP
.B c
(cleanup_on_exit) Shut the runtime down gracefully on exit. The option
also enables pooling (as in caml_startup_pooled). This mode can be used
to detect leaks with a third-party memory debugger.
.TP
.B p
Turn on debugging support for
.BR ocamlyacc -generated
Expand All @@ -145,9 +160,24 @@ Turn on randomization of all hash tables by default (see the
module of the standard library). This option takes no
argument.
.TP
.B t
Sets the trace level for the debug runtime (ignored otherwise).
.TP
.BR H
Allocates heap chunks by mmapping huge pages. Huge pages are locked into
kirisky marked this conversation as resolved.
Show resolved Hide resolved
memory, and are not swapped.
.TP
.BR h
The initial size of the major heap (in words).
.TP
.BR w
kirisky marked this conversation as resolved.
Show resolved Hide resolved
Sets size of window used by major GC for smoothing out variations in
its workload. This is an integer between 1 and 50. (Default: 1)
.TP
.BR W
Activates runtime warnings (such as Channel opened on file dies without
being closed, unflushed data, etc.)
.TP
.BR a \ (allocation_policy)
The policy used for allocating in the OCaml heap. Possible values
are 0 for the next-fit policy, 1 for the first-fit
Expand Down
11 changes: 9 additions & 2 deletions manual/src/cmds/runtime.etex
Expand Up @@ -68,7 +68,8 @@ section~\ref{s:ocamlrun-dllpath}).
Print the magic number of the bytecode executable given as argument
and exit.
\item["-M"]
Print the magic number expected by this version of the runtime and exit.
Print the magic number expected for bytecode executables by this version
of the runtime and exit.
\item["-p"]
Print the names of the primitives known to this version of
"ocamlrun" and exit.
Expand Down Expand Up @@ -136,7 +137,14 @@ The following environment variables are also consulted:
section~\ref{Hashtbl}).
\fi
This option takes no argument.
\item[H] Allocates heap chunks by mmapping huge pages. Huge pages are locked into
memory, and are not swapped.
\item[h] The initial size of the major heap (in words).
\item[w] Sets size of window used by major GC for smoothing out variations in
its workload. This is an integer between 1 and 50. (Default: 1)
\item[W] Activates runtime warnings (such as Channel opened on file dies without
being closed, unflushed data, etc.)
kirisky marked this conversation as resolved.
Show resolved Hide resolved
\item[t] Sets the trace level for the debug runtime (ignored otherwise).
kirisky marked this conversation as resolved.
Show resolved Hide resolved
\item[a] ("allocation_policy")
The policy used for allocating in the OCaml heap. Possible values
are "0" for the next-fit policy, "1" for the first-fit
Expand Down Expand Up @@ -171,7 +179,6 @@ The following environment variables are also consulted:
"caml_shutdown" in section~\ref{ss:c-embedded-code}). The option also enables
pooling (as in "caml_startup_pooled"). This mode can be used to detect
leaks with a third-party memory debugger.
% FIXME missing: H, t, w, W see MPR#7870
\item[M] ("custom_major_ratio") Target ratio of floating garbage to
major heap size for out-of-heap memory held by custom values
(e.g. bigarrays) located in the major heap. The GC speed is adjusted
Expand Down