first of all, I need to mention that there are 2 related threads, that I found usefull: 1, 2.
I am working with TeXstudio 2.8.8 on Win 7 64bit (i5 @3.3GHz, 8GB RAM - if this matters). My goal is to load multiple .tex files into my pdfLaTeX-document which have been created by matlab2tikz. It used to work fine, but since the datapoints have increased I and ran into the same problem as @user1996 in Link no. 1.
It still says: TeX capacity exceeded, sorry [main memory size=3000000].
At the moment there are 2 documents: the fist hast 40000 lines of autogereated code and the second one 10000. (In an \tikzpicture-environment)
I tried the solution suggested by @Joseph Wright in 1 but encountered the same problem as @Alexandre Willame described in his comment. I also tried the enable-write18 -extra-mem-bot=10000000 (and higher numbers) option, suggested by @Thomas F. Sturm in 1, but without success. The message is:TeX capacity exceeded, sorry [main memory size=13000000]. At a certian point I can't allocate more memory (Virtual memory exhausted), but it still gives me this message.
Finally I tried the way @A.GH suggested in 2. But this jeust resulted in an other (different) error message
I am really hoping for an answer / a way to implement the mentioned answers. The most wanted solution is the one from @Joseph Wright. But I don't know what's missing/wrong.
Additional Info:
(I am using pdfLaTeX)
In my preamble I wrote:
% TikZ
\usepackage{pgfplots}
% and optionally (as of Pgfplots 1.3):
\pgfplotsset{compat=newest}
\pgfplotsset{plot coordinates/math parser=false}
\newlength\figureheight
\newlength\figurewidth
% "TeX capacity exceeded, sorry [main memory size=3000000]."
\usepgfplotslibrary{external}
\tikzexternalize
externallibrary of PGFPlots or using thestandalonedocumentclass. (Searching here for examples will give you plenty of results, if you don't know what I am talking about.) – Stefan Pinnow Feb 14 '17 at 09:31