# Reached memory limit - just text - no TikZ - and correct code [closed]

I get the following error message:

! TeX capacity exceeded, sorry [main memory size=3000000].
\newpage ...k \@nobreakfalse \everypar {}\fi \par
\vfil \penalty -\@M
l.168 \newpage


I have to create a rather huge PDF in order to archive hundreds of textfiles. Using R and Sweave I ran a loop over all textfiles and put each file in a separate .tex file. Using \input all files are then put together. (Running the Sweave file with only a subset of the textfiles everything is OK. Therefore I can exclude an error in the code).

The font size is set to \tiny and after 1251 pages TeX stops compiling. So I fear this is really a memory-related problem.

I am using MikTeX 2.9, AucTeX, Emacs 24.2 on Windows 7

Thanks for every hint

-
The memory should be released as each page is shipped out so there may be something in your code that is stopping that which doesn't cause problems on small runs. You could try lualatex (which will dynamically allocate more memory but if you have an unbounded usage it will allocate a lot of memory so beware:-) Otherwise you would probably need to try to make a MWE (which might be hard) – David Carlisle Mar 18 at 15:40
Can you provide a MWE? – cacamailg Mar 18 at 15:40
Sorry, what do you mean with "MWE"? – Tim Mar 18 at 15:42
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Jubobs Mar 18 at 15:42
@Tim If you've fixed this we'll probably close it as "Too localised" as we don't like leaving questions unanswered. or you could delete. Sorry about the lack of welcome message I was thrown by the system saying you'd been a member for 9 months:-) – David Carlisle Mar 18 at 16:03