# Large datafile for pgfplots table gives out of memory

I have a problem with 3D plots (surf, contours, ...) when loading "large" tables of data. I get the error ! TeX capacity exceeded, sorry [main memory size=3000000]..

I found an aswer here, in particular to use pdflatex --enable-write18 --extra-mem-bot=10000000 --synctex=1 <filename> (since I'm a MikTeX user), but it doesn't work at all and I simply get ! TeX capacity exceeded, sorry [main memory size=13000000]..

Maybe it's important that I use TeXnicCenter, so I simply put --extra-mem-bot=10000000 in the proper option as you can see here (-synctex=-1 -interaction=nonstopmode "%Wm" -synctex=1 -shell-escape --extra-mem-bot=10000000), but I always get memory errors. To give maximum info, I uploaded the log file too.

The MWE is the following (I apologize if it includes more packages than necessary, but now I'm in total panic). As you can see I try to externalize, but it doesn't work anyway.

\documentclass[a4paper,11pt]{book}

\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{geometry}
\usepackage{bm}
\usepackage{calc}
\usepackage{tikz}
\usetikzlibrary{calc,decorations,patterns,shapes.arrows}
\usepackage{mathtools}
\usepackage{tikzscale}
\usetikzlibrary{external}
\tikzexternalize
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots,colormaps}
\usepackage[font=small,
format=hang,
labelfont={sf,bf},
tableposition=top,
figureposition=bottom]{caption}

\begin{document}

\begin{figure}[!h]
\centering
\begin{tikzpicture}
\begin{axis}[mesh]
% the following works (it's 31x31 grid)
% whereas the following doesn't, for being 101x101
\end{axis}
\end{tikzpicture}
\caption{Stream lines and contours of pressure.}
\label{fig:SPIKE_30x30_Re1000_it10000_p_psi}
\end{figure}

\end{document}


• It compiled for me with --extra-mem-top=10000000 (I didn't use the externalization, if you use it you will have to add the option to the program call used by the externalization code, see the documentation.). – Ulrike Fischer Oct 13 '15 at 12:00
• Ops.. In the answer I referenced there is an error: --extra-mem-bot=10000000 instead of --extra-mem-top=10000000. I changed to top and now the problem is fixed – Enrico Maria De Angelis Oct 13 '15 at 12:59
It compiled for me with --extra-mem-top=10000000 (I didn't use the externalization, if you use it you will have to add the option to the program call used by the externalization code, see the documentation.).
• Would it be useful to write explicitly that my error was to write bot instead of top? – Enrico Maria De Angelis Oct 16 '15 at 6:46