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.
If more information is needed for you to help me, please, let me know.
\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}
\pgfplotsset{compat=newest}
\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)
%\addplot3[mesh/rows=31,mesh/cols=31,mesh/ordering=colwise,shader=interp] table[x=X,y=Y,z=psi] {immagini/data/SPIKE_30x30_Re1000_it10000_psi.dat};
% whereas the following doesn't, for being 101x101
\addplot3[mesh/rows=101,mesh/cols=101,mesh/ordering=colwise,shader=interp] table[x=X,y=Y,z=psi] {immagini/data/SPIKE_100x100_Re1000_it10000_psi.dat};
\end{axis}
\end{tikzpicture}
\caption{Stream lines and contours of pressure.}
\label{fig:SPIKE_30x30_Re1000_it10000_p_psi}
\end{figure}
\end{document}
The datafile is downloadable here
EDIT: I encountered the same problem with the TeXLive distribution on a Mac OS X (using TeXShop as editor). Here is the question I posted, along with my self-answer, which can be an answer to the present question too (to use LuaLaTeX).
--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--extra-mem-bot=10000000instead of--extra-mem-top=10000000. I changed totopand now the problem is fixed – Enlico Oct 13 '15 at 12:59