</screen>
<para>RTS options taken from the <envar>GHCRTS</envar> environment
- variable can be overriden by options given on the command
+ variable can be overridden by options given on the command
line.</para>
</sect2>
<variablelist>
<varlistentry>
- <term><option>-A</option><replaceable>size</replaceable></term>
- <indexterm><primary><option>-A</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>allocation area, size</primary></indexterm>
+ <term>
+ <option>-A</option><replaceable>size</replaceable>
+ <indexterm><primary><option>-A</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>allocation area, size</primary></indexterm>
+ </term>
<listitem>
<para>[Default: 256k] Set the allocation area size
used by the garbage collector. The allocation area
</varlistentry>
<varlistentry>
- <term><option>-c</option></term>
- <indexterm><primary><option>-c</option></primary><secondary>RTS option</secondary>
- </indexterm>
- <indexterm><primary>garbage collection</primary><secondary>compacting</secondary>
- </indexterm>
- <indexterm><primary>compacting garbage collection</primary></indexterm>
-
+ <term>
+ <option>-c</option>
+ <indexterm><primary><option>-c</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>garbage collection</primary><secondary>compacting</secondary></indexterm>
+ <indexterm><primary>compacting garbage collection</primary></indexterm>
+ </term>
<listitem>
<para>Use a compacting algorithm for collecting the oldest
generation. By default, the oldest generation is collected
</varlistentry>
<varlistentry>
- <term><option>-F</option><replaceable>factor</replaceable></term>
+ <term>
+ <option>-F</option><replaceable>factor</replaceable>
+ <indexterm><primary><option>-F</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>heap size, factor</primary></indexterm>
+ </term>
<listitem>
- <indexterm><primary><option>-F</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>heap size, factor</primary></indexterm>
<para>[Default: 2] This option controls the amount
of memory reserved for the older generations (and in the
</varlistentry>
<varlistentry>
- <term><option>-G</option><replaceable>generations</replaceable></term>
- <indexterm><primary><option>-G</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>generations, number
- of</primary></indexterm>
+ <term>
+ <option>-G</option><replaceable>generations</replaceable>
+ <indexterm><primary><option>-G</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>generations, number of</primary></indexterm>
+ </term>
<listitem>
<para>[Default: 2] Set the number of generations
used by the garbage collector. The default of 2 seems to be
</varlistentry>
<varlistentry>
- <term><option>-H</option><replaceable>size</replaceable></term>
- <indexterm><primary><option>-H</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>heap size, suggested</primary></indexterm>
+ <term>
+ <option>-H</option><replaceable>size</replaceable>
+ <indexterm><primary><option>-H</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>heap size, suggested</primary></indexterm>
+ </term>
<listitem>
<para>[Default: 0] This option provides a
“suggested heap size” for the garbage collector. The
</varlistentry>
<varlistentry>
- <term><option>-k</option><replaceable>size</replaceable></term>
- <indexterm><primary><option>-k</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>stack, minimum size</primary></indexterm>
+ <term>
+ <option>-I</option><replaceable>seconds</replaceable>
+ <indexterm><primary><option>-H</option></primary>
+ <secondary>RTS option</secondary>
+ </indexterm>
+ <indexterm><primary>idle GC</primary>
+ </indexterm>
+ </term>
+ <listitem>
+ <para>(default: 0.3) In the threaded and SMP versions of the RTS (see
+ <option>-threaded</option>, <xref linkend="options-linker" />), a
+ major GC is automatically performed if the runtime has been idle
+ (no Haskell computation has been running) for a period of time.
+ The amount of idle time which must pass before a GC is performed is
+ set by the <option>-I</option><replaceable>seconds</replaceable>
+ option. Specifying <option>-I0</option> disables the idle GC.</para>
+
+ <para>For an interactive application, it is probably a good idea to
+ use the idle GC, because this will allow finalizers to run and
+ deadlocked threads to be detected in the idle time when no Haskell
+ computation is happening. Also, it will mean that a GC is less
+ likely to happen when the application is busy, and so
+ responsiveness may be improved. However, if the amount of live data in
+ the heap is particularly large, then the idle GC can cause a
+ significant delay, and too small an interval could adversely affect
+ interactive responsiveness.</para>
+
+ <para>This is an experimental feature, please let us know if it
+ causes problems and/or could benefit from further tuning.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <option>-k</option><replaceable>size</replaceable>
+ <indexterm><primary><option>-k</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>stack, minimum size</primary></indexterm>
+ </term>
<listitem>
<para>[Default: 1k] Set the initial stack size for
new threads. Thread stacks (including the main thread's
</varlistentry>
<varlistentry>
- <term><option>-K</option><replaceable>size</replaceable></term>
- <indexterm><primary><option>-K</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>stack, maximum size</primary></indexterm>
+ <term>
+ <option>-K</option><replaceable>size</replaceable>
+ <indexterm><primary><option>-K</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>stack, maximum size</primary></indexterm>
+ </term>
<listitem>
<para>[Default: 8M] Set the maximum stack size for
an individual thread to <replaceable>size</replaceable>
</varlistentry>
<varlistentry>
- <term><option>-m</option><replaceable>n</replaceable></term>
- <indexterm><primary><option>-m</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>heap, minimum free</primary></indexterm>
+ <term>
+ <option>-m</option><replaceable>n</replaceable>
+ <indexterm><primary><option>-m</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>heap, minimum free</primary></indexterm>
+ </term>
<listitem>
<para>Minimum % <replaceable>n</replaceable> of heap
which must be available for allocation. The default is
</varlistentry>
<varlistentry>
- <term><option>-M</option><replaceable>size</replaceable></term>
- <indexterm><primary><option>-M</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>heap size, maximum</primary></indexterm>
+ <term>
+ <option>-M</option><replaceable>size</replaceable>
+ <indexterm><primary><option>-M</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>heap size, maximum</primary></indexterm>
+ </term>
<listitem>
<para>[Default: unlimited] Set the maximum heap size to
<replaceable>size</replaceable> bytes. The heap normally
</varlistentry>
<varlistentry>
- <term><option>-s</option><replaceable>file</replaceable></term>
- <term><option>-S</option><replaceable>file</replaceable></term>
- <indexterm><primary><option>-S</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary><option>-s</option></primary><secondary>RTS option</secondary></indexterm>
+ <term>
+ <option>-s</option><replaceable>file</replaceable>
+ <indexterm><primary><option>-s</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
+ <term>
+ <option>-S</option><replaceable>file</replaceable>
+ <indexterm><primary><option>-S</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Write modest (<option>-s</option>) or verbose
(<option>-S</option>) garbage-collector statistics into file
</varlistentry>
<varlistentry>
- <term><option>-t</option></term>
- <indexterm><primary><option>-t</option></primary><secondary>RTS option</secondary></indexterm>
+ <term>
+ <option>-t</option>
+ <indexterm><primary><option>-t</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Write a one-line GC stats summary after running the
program. This output is in the same format as that produced
<variablelist>
<varlistentry>
- <term><option>-B</option></term>
- <indexterm><primary><option>-B</option></primary><secondary>RTS option</secondary></indexterm>
+ <term>
+ <option>-B</option>
+ <indexterm><primary><option>-B</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Sound the bell at the start of each (major) garbage
collection.</para>
</varlistentry>
<varlistentry>
- <term><option>-D</option><replaceable>num</replaceable></term>
- <indexterm><primary>-D</primary><secondary>RTS option</secondary></indexterm>
+ <term>
+ <option>-D</option><replaceable>num</replaceable>
+ <indexterm><primary>-D</primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>An RTS debugging flag; varying quantities of output
depending on which bits are set in
</varlistentry>
<varlistentry>
- <term><option>-r</option><replaceable>file</replaceable></term>
- <indexterm><primary><option>-r</option></primary><secondary>RTS option</secondary></indexterm>
- <indexterm><primary>ticky ticky profiling</primary></indexterm>
- <indexterm><primary>profiling</primary><secondary>ticky ticky</secondary></indexterm>
+ <term>
+ <option>-r</option><replaceable>file</replaceable>
+ <indexterm><primary><option>-r</option></primary><secondary>RTS option</secondary></indexterm>
+ <indexterm><primary>ticky ticky profiling</primary></indexterm>
+ <indexterm><primary>profiling</primary><secondary>ticky ticky</secondary></indexterm>
+ </term>
<listitem>
<para>Produce “ticky-ticky” statistics at the
end of the program run. The <replaceable>file</replaceable>
</varlistentry>
<varlistentry>
- <term><option>-xc</option></term>
- <indexterm><primary><option>-xc</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-xc</option>
+ <indexterm><primary><option>-xc</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>(Only available when the program is compiled for
profiling.) When an exception is raised in the program,
</varlistentry>
<varlistentry>
- <term><option>-Z</option></term>
- <indexterm><primary><option>-Z</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-Z</option>
+ <indexterm><primary><option>-Z</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Turn <emphasis>off</emphasis> “update-frame
squeezing” at garbage-collection time. (There's no
<variablelist>
<varlistentry>
- <term><function>void OutOfHeapHook (unsigned long, unsigned long)</function></term>
- <indexterm><primary><function>OutOfHeapHook</function></primary></indexterm>
+ <term>
+ <function>void OutOfHeapHook (unsigned long, unsigned long)</function>
+ <indexterm><primary><function>OutOfHeapHook</function></primary></indexterm>
+ </term>
<listitem>
<para>The heap-overflow message.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><function>void StackOverflowHook (long int)</function></term>
- <indexterm><primary><function>StackOverflowHook</function></primary></indexterm>
+ <term>
+ <function>void StackOverflowHook (long int)</function>
+ <indexterm><primary><function>StackOverflowHook</function></primary></indexterm>
+ </term>
<listitem>
<para>The stack-overflow message.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><function>void MallocFailHook (long int)</function></term>
- <indexterm><primary><function>MallocFailHook</function></primary></indexterm>
+ <term>
+ <function>void MallocFailHook (long int)</function>
+ <indexterm><primary><function>MallocFailHook</function></primary></indexterm>
+ </term>
<listitem>
<para>The message printed if <function>malloc</function>
fails.</para>