This latex code triggered Tex capacity exceed error:
\documentclass[10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{my style/.append style={axis x line=middle, axis y line=middle, xlabel={$x$}, ylabel={$y$}, axis equal }}
\begin{document}
\begin{tikzpicture}
\begin{axis}[my style, xtick={-3,-2,...,3}, ytick={-3,-2,...,3}, xmin=-3, xmax=3, ymin=-3, ymax=3]
\end{axis}
\end{tikzpicture}
\end{document}
Fix was to edit config file
nano -w /usr/share/texmf-dist/web2c/texmf.cnf
and edit main_memory and pool_size parameters
fmtutil-sys --all