# HG changeset patch
# User Volker Braun <vbraun.name@gmail.com>
# Date 1358876003 0
# Node ID 5697d3efcc9789025787340edcc45a7d40981ffc
# Parent c9344d1e1410be1d2e8fb5ea19352e545a58b9c7
Reduce memory usage when building docs
diff --git a/doc/common/build_options.py b/doc/common/build_options.py
a
|
b
|
|
17 | 17 | #Note that this needs to have the doctrees dir |
18 | 18 | ALLSPHINXOPTS = SPHINXOPTS + " " + PAPEROPTS + " " |
19 | 19 | WEBSITESPHINXOPTS = "" |
| 20 | |
| 21 | # Minimize GAP/libGAP RAM usage in the builder, docbuild already uses too much |
| 22 | from sage.interfaces.gap import set_gap_memory_pool_size |
| 23 | set_gap_memory_pool_size(0) # will be rounded up to 1M |
| 24 | |
diff --git a/doc/common/conf.py b/doc/common/conf.py
a
|
b
|
|
616 | 616 | app.connect('builder-inited', set_intersphinx_mappings) |
617 | 617 | app.connect('builder-inited', sphinx.ext.intersphinx.load_mappings) |
618 | 618 | app.connect('builder-inited', nitpick_patch_config) |
| 619 | # Minimize GAP/libGAP RAM usage when we build the docs |
| 620 | from sage.interfaces.gap import set_gap_memory_pool_size |
| 621 | set_gap_memory_pool_size(0) # will be rounded up to 1M |
619 | 622 | |
diff --git a/sage/interfaces/gap.py b/sage/interfaces/gap.py
a
|
b
|
|
1082 | 1082 | if max_workspace_size == None: |
1083 | 1083 | max_workspace_size = _get_gap_memory_pool_size_MB() |
1084 | 1084 | cmd += ' -o ' + str(max_workspace_size) |
| 1085 | cmd += ' -s ' + str(max_workspace_size) |
1085 | 1086 | cmd += ' ' + os.path.join(SAGE_EXTCODE,'gap','sage.g') |
1086 | 1087 | Expect.__init__(self, |
1087 | 1088 | name='gap', |
diff --git a/sage/libs/gap/util.pyx b/sage/libs/gap/util.pyx
a
|
b
|
|
184 | 184 | # Define argv and environ variables, which we will pass in to |
185 | 185 | # initialize GAP. Note that we must pass define the memory pool |
186 | 186 | # size! |
187 | | cdef char* argv[8] |
| 187 | cdef char* argv[12] |
188 | 188 | argv[0] = "sage" |
189 | 189 | argv[1] = "-l" |
190 | 190 | s = gap_root() |
191 | 191 | argv[2] = s |
192 | 192 | |
193 | | from sage.interfaces.gap import get_gap_memory_pool_size |
194 | | memory_pool = str(get_gap_memory_pool_size()) |
| 193 | from sage.interfaces.gap import _get_gap_memory_pool_size_MB |
| 194 | memory_pool = _get_gap_memory_pool_size_MB() |
195 | 195 | argv[3] = "-o" |
196 | 196 | argv[4] = memory_pool |
| 197 | argv[5] = "-s" |
| 198 | argv[6] = memory_pool |
197 | 199 | |
198 | | argv[5] = "-m" |
199 | | argv[6] = "64m" |
| 200 | argv[7] = "-m" |
| 201 | argv[8] = "64m" |
200 | 202 | |
201 | | argv[7] = "-q" # no prompt! |
202 | | argv[8] = "-T" # no debug loop |
203 | | argv[9] = NULL |
204 | | cdef int argc = 9 |
| 203 | argv[9] = "-q" # no prompt! |
| 204 | argv[10] = "-T" # no debug loop |
| 205 | argv[11] = NULL |
| 206 | cdef int argc = 11 # argv[argc] must be NULL |
205 | 207 | |
206 | 208 | # Initialize GAP and capture any error messages |
207 | 209 | # The initialization just prints error and does not use the error handler |