Increasing memory

LuaTeX uses dynamic memory allocation for main mem so the texmf.cnf setting you are using would have no effect even if you set if for luatex rather than pdftex.

However it does still inherit some fixed array usage from classic tex, including the number of strings.

this produces the error that you state (note it is an infinite loop so it relies on an error condition to terminate.

\documentclass{article}

\begin{document}

\loop
\iftrue
\advance\count0 1
\expandafter\def\csname zzz\the\count0\endcsname{}
\repeat
\end{document}

This produces

LaTeX2e <2019-10-01> patch level 3

luaotfload | main : initialization completed in 2.242 seconds
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/10/25 v1.4k Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size10.clo)) (./cc372.aux)
! TeX capacity exceeded, sorry [number of strings=493861].

You can increase the number of strings by calling it as follows (or by editing texmf.cnf)

$ max_strings=1000000 lualatex cc372
This is LuaTeX, Version 1.10.0 (TeX Live 2019) 
 restricted system commands enabled.
(./cc372.tex
LaTeX2e <2019-10-01> patch level 3

luaotfload | main : initialization completed in 2.141 seconds
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/10/25 v1.4k Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size10.clo)) (./cc372.aux)
! TeX capacity exceeded, sorry [hash size=665536].
<recently read> \endcsname 

Now you see it has not run out of strings but has overflown the hash table, which could be similarly increased. You need to iterate on your real document to increase whatever is needed.

Here, if I increase the size of the hash table enough, it takes several seconds to run, but eventually runs out of strings again:

$ max_strings=1000000 hash_extra=1000000 lualatex cc372
This is LuaTeX, Version 1.10.0 (TeX Live 2019) 
 restricted system commands enabled.
(./cc372.tex
LaTeX2e <2019-10-01> patch level 3

luaotfload | main : initialization completed in 2.187 seconds
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/10/25 v1.4k Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size10.clo)) (./cc372.aux)
! TeX capacity exceeded, sorry [number of strings=993861].