5

I'd like to enlarge the memory size used by xelatex. In the MikTeX documentation it says:

The name of the configuration file is that of the engine (e.g., miktex-pdftex) or format (e.g, miktex-pdflatex). You use the --edit-config-file option of initexmf to edit the configuration file, e.g.:

initexmf --edit-config-file=pdflatex

What shall I do in order to increase memory size used by xelatex?

initexmf --edit-config-file=xelatex
initexmf --edit-config-file=xetex
initexmf --edit-config-file=miktex-xetex

And which command do I have to run afterwards to apply the changes?

May I put the --admin option if I want to apply the changes to all system users?

Mik
  • 267
  • 1
    I don't think you should need no enlarge the memory... Are you getting an error saying that there is not enough memory? – Phelype Oleinik Jul 02 '18 at 11:44
  • Yes, I described the problem here – Mik Jul 02 '18 at 12:42
  • BTW, a similar problem is described in https://tex.stackexchange.com/questions/7953/how-to-expand-texs-main-memory-size-pgfplots-memory-overload – Mik Jul 02 '18 at 14:01
  • Sorry, I asked because usually (which is not always), increasing memory does not solve the problem because TeX is stuck in a loop. Of course this is not you case :) – Phelype Oleinik Jul 02 '18 at 14:03

2 Answers2

10

Your document uses really a lot of memory and for an unknown reason the default memory for xelatex is smaller then the one for pdflatex in miktex.

You can increase the memory with

initexmf --edit-config-file=xelatex

This will hopefully open xelatex.ini in your editor.

Then you can add either

 extra_mem_top = 2000000

This will work directly. Simply save the file.

Or add

 main_memory = 5000000

This will need a recreation of the format with (or with the console)

 initexmf --dump=xelatex

If you want to do it for all users use

 initexmf --admin --edit-config-file=xelatex

and

 initexmf --admin --dump=xelatex 

But be aware that user settings and user formats can shadow settings and formats of the admin and so non-admin calls are perhaps needed too -- I can't test this as I don't have a multi user installation.

Ulrike Fischer
  • 327,261
  • Thank you, @Ulrike. After After increasing the memory size with extra_mem_top = 2000000 I get another error:

    ! Output loop---100 consecutive dead cycles. \end@float ...loatpenalty <-@Mii \penalty -@Miv @tempdima \prevdepth \vbo... l.48 \end{figure}

    I've concluded that your \output is awry; it never does a \shipout, so I'm shipping \box255 out myself. Next time increase \maxdeadcycles if you want me to be more patient!

    – Mik Jul 02 '18 at 13:49
  • I had no problem with your example. But if in your real document you are really using so many floats (figure) it could be problematic. Insert \clearpage somewhere. – Ulrike Fischer Jul 02 '18 at 13:51
  • No, in my real document there are only 6 plots in one figure. – Mik Jul 02 '18 at 13:53
  • Ok, after setting extra_mem_top = 2000000in C:\ProgramData\MiKTeX\2.9\miktex\config\xelatex.ini my original document compiles again :) Thank you @Ulrike !!!! – Mik Jul 02 '18 at 14:07
  • You shouldn't change the original files. miktex can overwrite them at updates. – Ulrike Fischer Jul 02 '18 at 14:09
  • but that's the file which is opened when I type initexmf --admin --edit-config-file=xelatex Should I then save the modified file to somewhere else? – Mik Jul 02 '18 at 14:12
  • Ah. sorry I read program files and not programData. this should be ok. – Ulrike Fischer Jul 02 '18 at 14:13
1

For me the one thing that worked was to find the installation directory of MikTeX and change the parameters in the file <install dir>\miktex\config\texmfapp.ini. After doing that it worked like charm!

sophros
  • 163