# LaTeX capacity exceeded [duplicate]

Possible Duplicate:
How to expand TeX’s “main memory size”? (pgfplots memory overload)

I'm trying to compile a huge LaTeX file with many graphs in it. Those graphs are external files, formatted for PGFPlots. Although many of them compile fine, for some with a lot of data (30000+ lines) it gives me the following error:

TeX capacity exceeded, sorry [buffer size=200000].

Now, I'm on a machine with 16GB of RAM, so in theory there should be no problem in compiling those files. Is there a way to increase the size of the memory used by LaTeX and compile these files?

-

## migrated from stackoverflow.comNov 27 '12 at 13:12

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

## marked as duplicate by Jake, lockstep, Stefan Kottwitz♦Nov 27 '12 at 14:22

I tried that before asking, and it doesn't work. Also, increasing the memory too much leads to an error when compiling. –  Masiar Nov 23 '12 at 10:23
Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  egreg Nov 27 '12 at 13:23
The variable buf_size to which the message refers is the maximum length of a line that can be read in by the TeX programs. Isn't it possible to shorten the record lengths in those files? A problem may be in the fact that a { is open at the beginning and the matching } is at the end, depending on how you input the file. –  egreg Nov 27 '12 at 13:34

Consider using lualatex for the externalized images. It allocates more memory automatically.