I am using LuaLaTeX to compile a file that will have estimated 4,000 pages. Quite obviously, though for Lua engine itself there are no complications in the file, my system runs out of memory on Page 944. How am I able to create such a file?

I hope for a method that would allow me to compile the file in separate seances and fuse the results. Just splitting will mess with the page numbering. I want to avoid actually creating multiple volumes in separate files.

The problem apparently is in the complicated font setup, with luatex-ja used to work with a CJK font parallel to the original one, and the font itself redefined with an intricate fallback similar to this:

Extension = .ttc,
UprightFeatures = {
        AltFont = {
        {   Range="2C9CA,
        {   Range="2C710,
        ... (20 more definitions)

Log files

When compiling, the process just stops:

...[941] [942]
[943] [944]
! TeX capacity exceeded, sorry [node memory size=1821640]
! Sorry, I ran out of memory.

Cutting down on fonts changes nothing, but removing all the fallback substitutions at all immediately lets the file to compile.

  • How do you manage to run out of memory? And which memory?4000 pages should normally not be a problem. Aug 23, 2019 at 13:37
  • You probably need to give us more information about your setup. Given that lualatex does not hold the entire document in memory, something else might be at play.
    – daleif
    Aug 23, 2019 at 13:37
  • Fonts, probably. Added a description of my font setup in the question. Aug 23, 2019 at 13:42
  • 1
    Did you check, whether something on page 944 or previous make your system running out of memory? I had such problems with much smaller files but bad macros…
    – sztruks
    Aug 23, 2019 at 17:09
  • There is nothing special on page. Aug 24, 2019 at 14:43

1 Answer 1


Self-answer: after taking away all the heavy fonts (fallback was manually edited to delete all but needed symbols, compressing from 10 Mb to 66 kb (!)) but nothing changing, even the page being the same, the culprit was determined to be lualatex.exe itsef, who ridiculously ate 2 Gb of RAM and got stuck.

Thus, the solution from Will TeXLive 2014 be 64 bit? worked. (Note: now the link is https://ctan.org/tex-archive/systems/win32/w32tex/TLW64/.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.