I have big document in LaTeX (approx. 1000 pages, tens used packages, math, hundreds references \bibitem + \cite, cross-references \label + \ref, indices \index, tables and TikZ figures). The document is built from hundreds LaTeX files (using standalone and \input). TikZ figures are also in separate files with \tikzexternalenable (whenever it is possible), some of them have more than 1000 rows. When compiled by PdfLaTeX the TikZ figures are not recompiled (corresponding files *.dpth, *.log, *. md5 and *.pdf are unchanged with old date).
The document reached some limit because after adding new TikZ figure the compilation PdfLaTeX finish after the 2nd run with error:
the 1st processing by PdfLaTeX finish with "Process exited normally"
the 2nd processing by PdfLaTeX finish with error "TeX capacity exceeded, sorry [main memory size=123000000]" – every time in some TikZ file (which is not recompiled so I do not understand why problem is inside it)
In LOG file the location of error is described as follows (e.g.):
! TeX capacity exceeded, sorry [main memory size=123000000]. ...755) (1.6,0.149253036) (1.64,0. 14630663108) (1.68,0.14334... l.1661 \end{tikzpicture}
Summary in LOG file (problem is in "words of memory" record):
Here is how much of TeX's memory you used:
- 65319 strings out of 493340
- 1540999 string characters out of 3139331
- 123000001 words of memory out of 123000000
- 60823 multiletter control sequences out of 15000+200000
- 63320 words of font info for 190 fonts, out of 3000000 for 9000
- 1166 hyphenation exceptions out of 8191
- 114i,44n,128p,25560b,8155s stack positions out of 5000i,500n,10000p,200000b,50000s
- ! ==> Fatal error occurred, no output PDF file produced!
There are no syntax errors, because when I remove SOME TikZ figure then compilation is successful (I tried it with removing various figures, not with certain one).
Can somebody help me to find way for working with such big documents ?
Environment:
- Windows 10
- TexStudio 2.12.6
- MiKTeX 2.9
- PdfLaTeX command: pdflatex -synctex=1 -interaction=nonstopmode --shell-escape --enable-write18 --extra-mem-bot=120000000 ?me
Minimal Working Example is not attached, because problem occurs only with Maximal Working Example ...
Added 23.1.2018: This question was marked as an exact duplicate of an existing question - my problem is in compilation of big document with TikZ externalization in pdflatex if all (for me) known memory settings are on maximum - not "How to expand TeX's “main memory size”?"
In my case:
- externalize: it was used = no success (and still I do not understand why PDFLaTeX processes those TikZ files with big consumption of memmory while it does not create any new PDF external file for graphics ...)
- change "extra_mem_bot": it was set to maximal (possible in my PC) value 130000000 = no success
- add "extra_mem_top": I tried it with value 10000000 = no success
- add some setting to texmf.cnf: it is in TeXLive, not in TexStudio = so no success to add "save_size" or "main_memory"
- add some setting to pdftex.ini: this workaround is so suspicious that I had not enough courage to try it (especially after warnings "DO NOT EDIT THIS FILE DIRECTLY")
- use luatex: maybe, I will try, but it is run for longer distance
- I have converted all my files from Win1250 to UTF8
- I have changed several packages (for Unicode using)
- still I am not able to compile original document (e.g. luaLaTeX stops compilation after 100 errors = which in my case are undefined references typically defined in the second/third run)
--extra-mem-bot=120000000further? – David Carlisle Jan 21 '18 at 11:16figureenvironments that are floating for several pages then tex is having to hold them all in memory, you could consider not allowing them to float so much (or at all) and place the figures in the source closer to where they finally end, and perhaps use more\clearpageto flush some out of memory at good points. – David Carlisle Jan 21 '18 at 12:08\RequirePackage{luatex85}before\documentclass. Probably won't help, because I don't think thestandaloneproblem should be relevant here, but just in case. What does the log file say about the pictures? Does it say it is recompiling them and why? I don't think you can need--shell-escapeand thewrite18option. I think it is one or the other. Note that, by default, TikZ will recompile pictures if they are in a different slot in the sequence, even if the code has not altered. Or are you naming them? (Otherwise, how did you get them all compiled at all?) – cfr Jan 25 '18 at 00:35