[commit: ghc] master: Add +RTS -O<size> to control the minimum old gen size (890461e)

git at git.haskell.org git at git.haskell.org
Tue Apr 7 08:57:43 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/890461ee01901207f8703274ae413508a8df904a/ghc

>---------------------------------------------------------------

commit 890461ee01901207f8703274ae413508a8df904a
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Tue Mar 24 14:20:58 2015 +0000

    Add +RTS -O<size> to control the minimum old gen size


>---------------------------------------------------------------

890461ee01901207f8703274ae413508a8df904a
 docs/users_guide/runtime_control.xml | 15 +++++++++++++++
 rts/RtsFlags.c                       |  9 +++++++++
 2 files changed, 24 insertions(+)

diff --git a/docs/users_guide/runtime_control.xml b/docs/users_guide/runtime_control.xml
index a55a1fe..b7551eb 100644
--- a/docs/users_guide/runtime_control.xml
+++ b/docs/users_guide/runtime_control.xml
@@ -385,6 +385,21 @@ $ ./prog -f +RTS -H32m -S -RTS -h foo bar
       </varlistentry>
 
       <varlistentry>
+	<term>
+          <option>-O</option><replaceable>size</replaceable>
+          <indexterm><primary><option>-O</option></primary><secondary>RTS option</secondary></indexterm>
+          <indexterm><primary>old generation, size</primary></indexterm>
+        </term>
+	<listitem>
+          <para>[Default: 1m] Set the minimum size of the
+          old generation.  The old generation is collected whenever it
+          grows to this size or the value of the <option>-F</option> option
+          multiplied by the size of the live data at the previous major
+          collection, whichever is larger.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term>
           <option>-n</option><replaceable>size</replaceable>
           <indexterm><primary><option>-n</option></primary><secondary>RTS option</secondary></indexterm>
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index ef01ccb..5c7fcef 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -267,6 +267,7 @@ usage_text[] = {
 "  -kb<size> Sets the stack chunk buffer size (default 1k)",
 "",
 "  -A<size> Sets the minimum allocation area size (default 512k) Egs: -A1m -A10k",
+"  -O<size> Sets the minimum size of the old generation (default 1M)",
 "  -M<size> Sets the maximum heap size (default unlimited)  Egs: -M256k -M1G",
 "  -H<size> Sets the minimum heap size (default 0M)   Egs: -H24m  -H1G",
 "  -m<n>    Minimum % of heap which must be available (default 3%)",
@@ -971,6 +972,14 @@ error = rtsTrue;
                   }
                   break;
 
+              case 'O':
+                  OPTION_UNSAFE;
+                  RtsFlags.GcFlags.minOldGenSize =
+                      (nat)(decodeSize(rts_argv[arg], 2, BLOCK_SIZE,
+                                       HS_WORD_MAX)
+                            / BLOCK_SIZE);
+                  break;
+
               case 'I': /* idle GC delay */
                 OPTION_UNSAFE;
                 if (rts_argv[arg][2] == '\0') {



More information about the ghc-commits mailing list