# HG changeset patch
# User Armin Rigo <arigo@tunes.org>
# Date 1458369501 -3600
#      Sat Mar 19 07:38:21 2016 +0100
# Branch extradoc
# Node ID 8f629ad05c40b3bebcf3a5f9b69fce53a32fac00
# Parent  94a5ad8113da7470ee56a596929283d34fcffbe0
Update the "low on address space" comment

diff --git a/download.html b/download.html
--- a/download.html
+++ b/download.html
@@ -291,7 +291,8 @@
 machine with insufficient RAM!  It will just swap forever.  See
 notes below in that case.)</p>
 </li>
-<li><p class="first">If you want to install this PyPy as root, please read the next section.</p>
+<li><p class="first">If you want to install this PyPy as root, please read the next section,
+<a class="reference internal" href="#packaging">Packaging</a>.</p>
 </li>
 </ol>
 <p>Notes:</p>
@@ -300,16 +301,25 @@
 because it is twice as fast.  You should just start by downloading an
 official release of PyPy (with the JIT).  If you really have to use CPython
 then note that we are talking about CPython 2.7 here, not CPython 3.x.
-(CPython 2.6 might or might not work.  Older versions are out.)</p>
+(Older versions like 2.6 are out.)</p>
 </li>
-<li><p class="first">If RAM usage is a problem (or if you are on Windows, because win32's limit
-is 2 GB unless you <a class="reference external" href="http://doc.pypy.org/en/latest/windows.html#preparing-windows-for-the-large-build">have a 64 bit OS</a>), then you can (for now) tweak some parameters
-via environment variables and command-line options.  The following command
-takes a bit more time, but finishes with only using 3.0 GB of RAM (on
-Linux 64-bit; probably not much more than 1.6 GB on 32-bit).  It should be
-noted that it is less than with CPython.</p>
+<li><p class="first">On some 32-bit systems, the address space limit of 2 or 3 GB of RAM
+can be an issue.  More generally you may be just a little bit low of
+RAM.  First note that 2 GB is really not enough nowadays; on Windows
+you first need to refer to the <a class="reference external" href="http://doc.pypy.org/en/latest/windows.html#preparing-windows-for-the-large-build">Windows build instructions</a>.  More
+precisely, translation on 32-bit takes at this point 2.7 GB if PyPy is
+used and 2.9 GB if CPython is used.  There are two workarounds:</p>
+<p>1. use PyPy, not CPython.  If you don't have any PyPy so far, not even
+an older version, then you need to build one first, with some parts
+removed.  So, first translate with <tt class="docutils literal"><span class="pre">...rpython</span> <span class="pre">-Ojit</span>
+targetpypystandalone <span class="pre">--withoutmod-micronumpy</span> <span class="pre">--withoutmod-cpyext</span></tt>,
+then copy <tt class="docutils literal"><span class="pre">pypy-c</span></tt> and <tt class="docutils literal">libpypy_c.so</tt> somewhere else, and finally
+call it with <tt class="docutils literal"><span class="pre">...pypy-c</span> <span class="pre">../../rpython/bin/rpython</span> <span class="pre">-Ojit</span></tt>.</p>
+<p>2. if even using PyPy instead of CPython is not enough, try to tweak
+some internal parameters.  Example (slower but saves around 400MB):</p>
 <pre class="literal-block">
-PYPY_GC_MAX_DELTA=200MB pypy --jit loop_longevity=300 ../../rpython/bin/rpython -Ojit targetpypystandalone
+PYPY_DONT_RUN_SUBPROCESS=1 PYPY_GC_MAX_DELTA=200MB pypy --jit loop_longevity=300 ../../rpython/bin/rpython -Ojit --source
+# then read the next point about --source
 </pre>
 </li>
 <li><p class="first">You can run translations with <tt class="docutils literal"><span class="pre">--source</span></tt>, which only builds the C
diff --git a/source/download.txt b/source/download.txt
--- a/source/download.txt
+++ b/source/download.txt
@@ -313,7 +313,8 @@
    machine with insufficient RAM!  It will just swap forever.  See
    notes below in that case.)
 
-6. If you want to install this PyPy as root, please read the next section.
+6. If you want to install this PyPy as root, please read the next section,
+   Packaging_.
 
 Notes:
 
@@ -321,16 +322,27 @@
   because it is twice as fast.  You should just start by downloading an
   official release of PyPy (with the JIT).  If you really have to use CPython
   then note that we are talking about CPython 2.7 here, not CPython 3.x.
-  (CPython 2.6 might or might not work.  Older versions are out.)
+  (Older versions like 2.6 are out.)
 
-* If RAM usage is a problem (or if you are on Windows, because win32's limit
-  is 2 GB unless you `have a 64 bit OS`_), then you can (for now) tweak some parameters
-  via environment variables and command-line options.  The following command
-  takes a bit more time, but finishes with only using 3.0 GB of RAM (on
-  Linux 64-bit; probably not much more than 1.6 GB on 32-bit).  It should be
-  noted that it is less than with CPython. ::
+* On some 32-bit systems, the address space limit of 2 or 3 GB of RAM
+  can be an issue.  More generally you may be just a little bit low of
+  RAM.  First note that 2 GB is really not enough nowadays; on Windows
+  you first need to refer to the `Windows build instructions`_.  More
+  precisely, translation on 32-bit takes at this point 2.7 GB if PyPy is
+  used and 2.9 GB if CPython is used.  There are two workarounds:
+  
+  1. use PyPy, not CPython.  If you don't have any PyPy so far, not even
+  an older version, then you need to build one first, with some parts
+  removed.  So, first translate with ``...rpython -Ojit
+  targetpypystandalone --withoutmod-micronumpy --withoutmod-cpyext``,
+  then copy ``pypy-c`` and ``libpypy_c.so`` somewhere else, and finally
+  call it with ``...pypy-c ../../rpython/bin/rpython -Ojit``.
 
-    PYPY_GC_MAX_DELTA=200MB pypy --jit loop_longevity=300 ../../rpython/bin/rpython -Ojit targetpypystandalone
+  2. if even using PyPy instead of CPython is not enough, try to tweak
+  some internal parameters.  Example (slower but saves around 400MB)::
+
+    PYPY_DONT_RUN_SUBPROCESS=1 PYPY_GC_MAX_DELTA=200MB pypy --jit loop_longevity=300 ../../rpython/bin/rpython -Ojit --source
+    # then read the next point about --source
 
 * You can run translations with ``--source``, which only builds the C
   source files (and prints at the end where).  Then you can ``cd`` there
@@ -360,7 +372,7 @@
 .. _`sandboxing`: features.html#sandboxing
 .. _`stackless`: http://www.stackless.com/
 .. _`greenlets`: http://pypy.readthedocs.org/en/latest/stackless.html#greenlets
-.. _`have a 64 bit OS`: http://doc.pypy.org/en/latest/windows.html#preparing-windows-for-the-large-build
+.. _`Windows build instructions`: http://doc.pypy.org/en/latest/windows.html#preparing-windows-for-the-large-build
 .. _`shadow stack`: http://pypy.readthedocs.org/en/latest/config/translation.gcrootfinder.html
 .. _Mercurial: http://mercurial.selenic.com/