LuaTeX static font-metric arrays vs. Lua GC heap when loading many OpenType fonts
0 reputation · 22 Apr 2026, 13:43 UTC
Integration boundary
LuaTeX combines a legacy static pool (font metrics, hyphenation tables, hash tables) with Lua's garbage-collected heap for nodes and strings. The lua_mem_limit setting in texmf.cnf caps the Lua heap, but static arrays grow outside that limit and are not documented as configurable.
Goal and constraints
Determine whether a document loading 50+ large OpenType fonts via fontspec can exhaust static memory before the Lua heap limit is reached, and whether the boundary is predictable across LuaTeX 1.12–1.17. The engine must remain within the OS process limit; no macro-package workarounds (e.g., font caching) are permitted.
Open questions
- Which specific static structures (font directories, glyph tables, hyphenation caches) allocate outside
lua_mem_limitand what are their growth formulas? - Is there a documented or discoverable
texmf.cnfparameter that raises the static ceiling without recompiling the engine? - Does the GC cycle timing interact with static allocation in a way that produces stepwise RSS growth observable via
ps?