Ticket #13588: trac_13588_docbuild.patch

File trac_13588_docbuild.patch, 2.9 KB (added by vbraun, 9 years ago)

Updated patch

  • doc/common/build_options.py

    # 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  
    1717#Note that this needs to have the doctrees dir   
    1818ALLSPHINXOPTS   = SPHINXOPTS + " " + PAPEROPTS + " "
    1919WEBSITESPHINXOPTS = ""
     20
     21# Minimize GAP/libGAP RAM usage in the builder, docbuild already uses too much
     22from sage.interfaces.gap import set_gap_memory_pool_size
     23set_gap_memory_pool_size(0)  # will be rounded up to 1M
     24
  • doc/common/conf.py

    diff --git a/doc/common/conf.py b/doc/common/conf.py
    a b  
    616616        app.connect('builder-inited', set_intersphinx_mappings)
    617617        app.connect('builder-inited', sphinx.ext.intersphinx.load_mappings)
    618618        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
    619622
  • sage/interfaces/gap.py

    diff --git a/sage/interfaces/gap.py b/sage/interfaces/gap.py
    a b  
    10821082        if max_workspace_size == None:
    10831083            max_workspace_size = _get_gap_memory_pool_size_MB()
    10841084        cmd += ' -o ' + str(max_workspace_size)
     1085        cmd += ' -s ' + str(max_workspace_size)
    10851086        cmd += ' ' + os.path.join(SAGE_EXTCODE,'gap','sage.g')
    10861087        Expect.__init__(self,
    10871088                        name='gap',
  • sage/libs/gap/util.pyx

    diff --git a/sage/libs/gap/util.pyx b/sage/libs/gap/util.pyx
    a b  
    184184    # Define argv and environ variables, which we will pass in to
    185185    # initialize GAP. Note that we must pass define the memory pool
    186186    # size!
    187     cdef char* argv[8]
     187    cdef char* argv[12]
    188188    argv[0] = "sage"
    189189    argv[1] = "-l"
    190190    s = gap_root()
    191191    argv[2] = s
    192192
    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()
    195195    argv[3] = "-o"
    196196    argv[4] = memory_pool
     197    argv[5] = "-s"
     198    argv[6] = memory_pool
    197199               
    198     argv[5] = "-m"
    199     argv[6] = "64m"
     200    argv[7] = "-m"
     201    argv[8] = "64m"
    200202   
    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
    205207
    206208    # Initialize GAP and capture any error messages
    207209    # The initialization just prints error and does not use the error handler