It’s Lua scripting engine not having enough memory reserved to do it’s thang.
IIRC the crafting stuff can exceed the limits and crash, even if you don’t use mods and many items; it’s not a memory leak and sadly the error popup is under the generic “out of memory”.
Increasing the memory reserved for Lua stuff (internal scripts) should avoid crashes of this type.