next up previous contents
Next: Foreign function interface (FFI) Up: Manual page Previous: Compile-time options   Contents


Runtime system options

To control the runtime system, executables produced by MLton take several optional command line arguments before their usual arguments. To use these options, the first argument to the executable must be ``@MLton''. The optional arguments then follow, must be terminated by ``--'', and are followed by any arguments to the program. The optional arguments are not made available to the SML program via CommandLine.arguments. For example, a valid call to hello-world is:

hello-world @MLton gc-summary fixed-heap 10k --
In the above example, CommandLine.arguments () = [].

fixed-heap n[km]

Use a fixed size heap of n bytes. A trailing k means that n is in units of 1024 bytes. A trailing m means that n is in megabytes. If neither appear, then n is in bytes. A value of 0 means to use the maximum amount of RAM available.

gc-messages

Print a message at the start and end of every garbage collection.

gc-summary

Print a summary of garbage collection statistics upon program termination.

load-world world

Restart the computation with the file specified by world. The world file must have been created by a call to MLton.World.save by the same executable. See Section 8.2.15 for details.

max-heap n[km]

Run the computation with an automatically resized heap that is never larger than n. The meaning of [km] is the same as with the fixed-heap option.

These options can also control the compiler, as in
mlton @MLton max-heap 100m -- foo.sml

next up previous contents
Next: Foreign function interface (FFI) Up: Manual page Previous: Compile-time options   Contents