Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

With today's computers having several gigabytes of memory, why does TeX still have such limited capacity, and why are modern TeX installations not adjusted for higher capacity by default? Why is adjusting TeX capacity only recommended as a last resort?

share|improve this question
3  
I have not managed to let LuaLaTeX run out of memory. So I do not think your premise holds for modern TeX installations. –  Alexander Jul 18 '13 at 16:34
4  
@DragonLord the input stack is not fixed it is setable in texmf.cnf (stack_size = 5000 by default in texlive 2013) To be honest I have never hit that in a document that was not looping so would hit any limit. –  David Carlisle Jul 18 '13 at 16:41
5  
most instances of running out of space, in practice, are due to code loops. except for a very few elements (e.g. math families) that have (historical) structural reasons for being limited, higher capacity can be defined. but if memory failure is caused by a loop, this only results in longer delays and significant frustration. if you know that you will be reading files with significantly long input lines, or reading several thousand files to compile a particular collection, then it makes sense to increase those sizes. but do it cautiously. –  barbara beeton Jul 18 '13 at 16:45
5  
TeX was developed when dynamically allocated memory was out of the question for many (all?) operating systems. Changing this model would require extensive surgery on the most delicate parts of the program. LuaTeX has basically been rewritten from scratch, so it can take advantage of more modern C libraries. –  egreg Jul 18 '13 at 17:15
2  
show 2 more comments

1 Answer

up vote 5 down vote accepted

(CW from comments)

The answers to http://tex.stackexchange.com/a/27482/963 show that TeX is able to cope with huge documents. However, memory intensive packages such as pgfplots can cause TeX to run out of memory; here by TeX WEB based implementations, that is, Knuth TeX, pdfTeX and XeTeX, are meant. LuaTeX is different on this respect, because it indeed allocates memory dynamically. However, also LuaTeX sets limits for registers (65536 of each kind) and math families (256).

TeX was developed when dynamically allocated memory was out of the question for many (all?) operating systems. Changing this model would require extensive surgery on the most delicate parts of the program. LuaTeX has basically been rewritten from scratch, so it can take advantage of more modern C libraries.

Most instances of running out of space, in practice, are due to code loops. except for a very few elements (e.g. math families) that have (historical) structural reasons for being limited, higher capacity can be defined. but if memory failure is caused by a loop, this only results in longer delays and significant frustration. if you know that you will be reading files with significantly long input lines, or reading several thousand files to compile a particular collection, then it makes sense to increase those sizes. but do it cautiously.

share|improve this answer
    
berthold horne was proud of Y&Y's dynamic memory code (he told me it was difficult code to write, and i have no reason to disbelieve him). since all that code is now in the public domain, one could in principal retrofit it to the two knuth-based systems currently supported (pdftex and xetex, aiui); no-one's made any move to do so, and so the conclusion must be that modern programmers can't be bothered, while we oldies are used to tex's limitations, and can usually wriggle out of enough memory limitations that we don't feel the need. –  wasteofspace Nov 2 '13 at 23:59
    
@wasteofspace I don't really know about Y&Y's TeX. –  egreg Nov 3 '13 at 0:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.