The issue is quite simple, I have a bunch of figures being generated with tikz (which in turn calls gnuplot). In order to bypass the memory issue I externalised tikz, which was fine until I tried plotting a larger contour (around 100k points). I now get the "! TeX capacity exceeded, sorry [main memory size=10000000]." error even if I increase the main memory by editing texmf.cnf
I can plot the figure in question with gnuplot independently but would rather have it done within the latex file for easier editing.