# Excessive memory use with unicode-math/Fira Sans and xfrac

When trying to use the Greek symbols in the font Fira Sans with unicode-math, I noticed that running lualatex on my document uses up enormous amounts of RAM. I have distilled my problem to a minimal working example:

\documentclass{article}

\usepackage{unicode-math}
\setmathfont{latinmodern-math.otf}
% each of the following \setmathfont lines adds around 1GB of used RAM
\setmathfont{FiraSans-Regular.otf}[range=up/{greek,Greek}]
\setmathfont{FiraSans-Italic.otf}[range=it/{greek,Greek}]
\setmathfont{FiraSans-Bold.otf}[range=bfup/{greek,Greek}]
\setmathfont{FiraSans-BoldItalic.otf}[range=bfit/{greek,Greek}]
\usepackage{xfrac}

\begin{document}

$\sfrac{1}{2}$

\end{document}


Running this with lualatex uses around 4GB of memory (and takes a quite while to complete). For longer documents, this grows even more, eventually filling all the RAM I have available.

I have noticed that when running this, execution seems to take a lot of time during the following part of the output (during which memory usage increases continuously):

(load luc: ~/.texlive2018/texmf-var/luatex-cache/generic/fonts/otl/lmroman7-regular.luc)

xelatex handles the same example in a fraction of a second and without unexpected use of memory (maybe not surprising, since the lines above are related to luatex’s font cache).
• It works okay, if I use \setmathfont{FiraMath} instead of text fonts. – Ulrike Fischer Mar 26 at 13:05