summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-10-07 14:47:51 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-10-10 10:45:47 +0100
commitf65bbbe02555b20e219e4ad3a540d385ae393092 (patch)
treedf804b829c5efc2907a7eacdc5e2c523045ef454 /docs
parentfa278b82730c2d18297bc9c8567b1b35a8769f5f (diff)
downloadhaskell-f65bbbe02555b20e219e4ad3a540d385ae393092.tar.gz
document the -H option
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/runtime_control.xml38
1 files changed, 23 insertions, 15 deletions
diff --git a/docs/users_guide/runtime_control.xml b/docs/users_guide/runtime_control.xml
index 48ea0a875b..2af87bcc41 100644
--- a/docs/users_guide/runtime_control.xml
+++ b/docs/users_guide/runtime_control.xml
@@ -543,26 +543,34 @@ char *ghc_rts_opts = "-H128m -K1m";
<varlistentry>
<term>
- <option>-H</option><replaceable>size</replaceable>
+ <option>-H</option><optional><replaceable>size</replaceable></optional>
<indexterm><primary><option>-H</option></primary><secondary>RTS option</secondary></indexterm>
<indexterm><primary>heap size, suggested</primary></indexterm>
</term>
<listitem>
<para>&lsqb;Default: 0&rsqb; This option provides a
- &ldquo;suggested heap size&rdquo; for the garbage collector. The
- garbage collector will use about this much memory until the
- program residency grows and the heap size needs to be
- expanded to retain reasonable performance.</para>
-
- <para>By default, the heap will start small, and grow and
- shrink as necessary. This can be bad for performance, so if
- you have plenty of memory it's worthwhile supplying a big
- <option>-H</option><replaceable>size</replaceable>. For
- improving GC performance, using
- <option>-H</option><replaceable>size</replaceable> is
- usually a better bet than
- <option>-A</option><replaceable>size</replaceable>.</para>
- </listitem>
+ &ldquo;suggested heap size&rdquo; for the garbage
+ collector. Think
+ of <option>-H<replaceable>size</replaceable></option> as a
+ variable <option>-A</option> option. It says: I want to
+ use at least <replaceable>size</replaceable> bytes, so use
+ whatever is left over to increase the <option>-A</option>
+ value.</para>
+
+ <para>This option does not put
+ a <emphasis>limit</emphasis> on the heap size: the heap
+ may grow beyond the given size as usual.</para>
+
+ <para>If <replaceable>size</replaceable> is omitted, then
+ the garbage collector will take the size of the heap at
+ the previous GC as the <replaceable>size</replaceable>.
+ This has the effect of allowing for a
+ larger <option>-A</option> value but without increasing
+ the overall memory requirements of the program. It can be
+ useful when the default small <option>-A</option> value is
+ suboptimal, as it can be in programs that create large
+ amounts of long-lived data.</para>
+ </listitem>
</varlistentry>
<varlistentry>