[Dev-luatex] fontloader's memory leaks

Khaled Hosny khaledhosny at eglug.org
Mon Feb 15 20:55:39 CET 2010

We are writing a font indexing script[1] for use with LaTeX and plain
TeX (luaotfload package[2]), in order to gather all the info we need
(mainly, names table and optical size) we are loading the fonts with the
full blown fontloader.open(), now the problem is that memory consumption
is steadily growing to the point that it can hang the whole system (I had
to use a 2 GB swap instead of .5 GB + 1 GB memory to avoid system freeze)
despite the fact that every open() call is followed by a close() call.

It seems that fontloader.close() is not freeing the memory as it should
(valgrind reports too many potential memory leaks). Any idea, is there a
possibility for this to get improved?

[1] http://github.com/mpg/luaotfload/blob/master/luaotfload-fonts.lua
[2] http://github.com/mpg/luaotfload

I tried to extend fontloader.info() to return the additional info we need
and I managed to get the names and pfm tables and it was still as fast,
but stopped at optical size info which for a reason beyond to me is
implemented by OpenType specifications as a GPOS feature! and I couldn't
get fontloader to parse GPOS table without parsing glyphs first.


 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer

More information about the dev-luatex mailing list