# Increase LaTeX capacity

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.

-

## migrated from stackoverflow.comAug 21 '11 at 4:02

This question came from our site for professional and enthusiast programmers.

How many of your pages are already there? –  Paŭlo Ebermann Aug 21 '11 at 1:04
Perhaps this entry on the UK TeX FAQ will help tackle the problem: Enlarging TeX, or section 6 Memory and Speed Considerations of the pgfplots package documentation. –  Werner Aug 21 '11 at 4:29
Can you give a little more of your log file. In my experience many capicity problem is not really about memory. It could be something wrong in your macros. Try to exclude parts of your documents one by one and produce a minimal example that produce this error. –  Yan Zhou Aug 21 '11 at 7:41
–  Peter Grill Jan 11 '14 at 20:05

Put into your local TeX configuration file, which is for TeXLive in .../texlive/2011/texmf.cnf, for example,

pool_size = 3250000


Then run 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

kpsewhich texmf.cnf


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

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:

/some/path/to/texlive/2011/texmf/web2c/texmf.cnf


(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 /doc/generic/pgf/tex-en/texmf.cnf)

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:

/some/path/to/texlive/2011/texmf/web2c/texmf.cnf


/some/path/to/texlive/2011/texmf.cnf


For example, MacTeX adds in the file /usr/local/texlive/2011/texmf.cnf:

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 MakeFile

It employs a 'texmf.cnf' which lies in ../../text-en. dist: FORCE

export TEXMFCNF="../../text-en:\$(TEXMFCNF)"; This is interesting to see how you can compile the pgfmanual. This documentation needs a lot of memory to be compiled

-
main_memory should be less than 8,000,000 total. See the comment in the texmf.cnf. –  kiss my armpit Apr 22 '13 at 19:11
@Bugbusters Thanks ! do you know why ? –  Alain Matthes Apr 22 '13 at 20:00
I don't know. :-) –  kiss my armpit Apr 22 '13 at 20:03

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.

-