I am trying to compile a TeX file, but after a long time I got this message:
l.3593 ...temp.png} 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: 31937 strings out of 94500 1176767 string characters out of 1176767 272586 words of memory out of 1000000 24170 multiletter control sequences out of 10000+50000 11185 words of font info for 39 fonts, out of 500000 for 2000 580 hyphenation exceptions out of 1000 28i,7n,36p,345b,3810s stack positions out of 1500i,500n,5000p,200000b,5000s PDF statistics: 33619 PDF objects out of 300000 7356 named destinations out of 131072 48094 words of extra memory for PDF output out of 65536 ! ==> Fatal error occurred, the output PDF file is not finished!
Perhaps my file is huge (like 4000 pages) and this is the reason for this.
Put into your local TeX configuration file, which is for TeXLive in
.../texlive/2011/texmf.cnf, for example,
pool_size = 3250000
sudo fmtutil-sys --all. For MiKTeX it should be possible to change such values from within the MiKTeX configuration GUI.
If you do not find the file run
it shows the location.
Another solution is to use LuaLaTeX.
Use luatex it dynamically allocates memory so you are limited by the physical memory available
(from: How to avoid exceeding TeX capacity when using multi-page tables? )
But just watch the memory usage. While the old TeX engine had hardcoded, fixed-length limits, LuaTeX will use as much memory as it needs.
You have several possibilities if you use TeXLive (with MikTeX see Werner’s link at the question comment).
1) A simple but “bad” method: you can modify the original
texmf.cnf. This file is here:
(2011 for me but it’s the same with 2010) BUT If you modify this original file, YOUR CHANGES WILL BE LOST when it is updated.
What can you modify?
The values below are used for the pgf manual (see
main_memory = 9000000 % words extra_mem_top = 6000000 % extra high memory for chars, tokens, etc. extra_mem_bot = 6000000 % extra low memory for boxes, glue, breakpoints, % Extra space for the hash table of control sequences (which allows 10K % names as distributed). hash_extra = 200000 % Max number of characters in all strings, including all error messages, % help texts, font names, control sequences. These values apply to TeX and MP. pool_size = 3850000
2) Better, instead of modifying the original file, put your changes, and only your changes, in
../../texmf.cnf. That is, if this file is installed in:
add your custom settings to
For example, MacTeX adds in the file
TEXMFHOME = ~/Library/texmf TEXMFVAR = ~/Library/texlive/2011/texmf-var TEXMFCONFIG = ~/Library/texlive/2011/texmf-config
Important : include only your changed values, not a copy of the whole thing!
3) Another possibility is to use another file. This is described in the section 6 Memory and Speed Considerations of the
pgfplots package, but you can use a variant like the one used for the pgfmanual if you know how to use a
It employs a ‘texmf.cnf’ which lies in ../../text-en. dist: FORCE
This is interesting to see how you can compile the pgfmanual. This documentation needs a lot of memory to be compiled
You should split your document into smaller parts or recompile the TeX package to increase the available space. You have exhausted the available string characters.