# Memory Exceeded - Words of Memory

Hoping someone might able to assist or point me in a direction to possibly solve this issue if at all can be.

I am creating a very large TEX file using LaTeX pdf. I know after reviewing many posts here of how to extend memory etc which I have done, however regardless of that my publication still exceeds TEX's memory capacity.

I am also aware of what is potentially causing the issue and that is likely TIKZ pgf plots. I am also aware that a potential solution for this is possibly LuaLatex, however, converting to LuaLatex would require a whole lot of re-coding on my behalf which I want to avoid. I have attempted this and the formatting of the output is a mess using LuaLatex also.

The publication I am attempting to produce is in excess of 15K pdf pages and has many images and node plots hence the issue with memory. However, the actual LOG suggests (SEE BELOW) the issue is regarding Words of Memory and not the images or plots being created or at least I think that's what it is telling me.

Log output summary as follows:

``````! TeX capacity exceeded, sorry [main memory size=10000000].
\g__morewrites_iow_34_tl ...__morewrites_iow \ETC.

l.2485399 }{\ignorespaces}
^^M
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.

Here is how much of TeX's memory you used:
211634 strings out of 482424
5317432 string characters out of 8697731
10000001 words of memory out of 10000000
172893 multiletter control sequences out of 15000+600000
548576 words of font info for 82 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
65i,15n,111p,2722b,2922s stack positions out of 5000i,500n,10000p,30000000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!
``````

So as you can see from the error there is 2.5m line of output when latex says "NO MORE - I QUIT" the log file does not contain any other LaTex coding errors. except for underfull or overfull warnings that is.

I am currently reviewing the VOLUMES package to see if this will assist by breaking up the output into smaller TEX files, but I am concerned even by doing this when compiling the combined files will still likely fail.

Anybody perhaps has some ideas, pointers or dare I ask a solution?

• You might try selecting a few of the really big tikz plots that occur before the job quit, compiling them separately into pdf files, and dropping those in with `\includegraphics`. If your hypothesis is correct, that these are the problem, and the job gets further along after such a change, that's good supporting evidence. – barbara beeton Jun 14 '20 at 1:28
• @barbara beeton - Well I am not entirely certain it is TIKZ IMHO - however everything kinda suggests that it is - So I understand you correctly - if I was to compile the output into smaller PDF's the I combine them using includegraphics? Also could explain by chance specifically what TEX is refering to with teh "WORDS OF MEMORY" is it a word count issue or something else? 0- Many Thanks – user204824 Jun 14 '20 at 1:49
• "Words of memory" has nothing to do with word count. These days, most hardware is based on 32-bit words, and this is the area used for calculations, storing interim results (e.g., a page of a document or other object before it is completed and shipped out) and other program requirements. (La)TeX has several memory blocks of different sizes devoted to different purposes; you can see these in the report you posted. The memory block referred to here is the "working memory", used to accumulate an object in progress. Tikz is greedy, so is a known candidate for exceeding memory. – barbara beeton Jun 14 '20 at 2:52
• @barbara beeton - Many thanks for the explanation - much appreciated – user204824 Jun 14 '20 at 3:02
• the tikz externalize mechanism automates running the tikz pictures as separate tex runs and including the generated pdfs. but main mem is mostly cleared as each page is shipped out, do you have a lot of tikz figures in floating figures that are being held up for several pages taking up memory? – David Carlisle Jun 14 '20 at 8:45