Hi, Hans:

in font-afm.lua, you use fontforge to open and to_table a pfb, but
without closing it?

btw, when MKIV is running for the first time (i.e., no cache file). it
will use a lot of memory (parsing a 10M font will use 700-800 MB
memory), are there some ways to reduce that? Another problem is, the
memory usage seems incremental:
I watch the memory usage in "top" carefully, it does not reduce when
MKIV finish reading and caching an otf font. (well I read the
font-otf.lua, and you are actually closing that font. so maybe that's
because luatex is leaking memory?)

btw, I load arial 300 times using the following file,

%engine=luatex
\directlua0{
function load_font (filename)
local metrics = nil
    local font = fontforge.open(filename)
    if font then
        metrics = fontforge.to_table(font)
        fontforge.close(font)
    end
    return metrics
end
myfont = load_font('arial.ttf')
% 300 myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
myfont = load_font('arial.ttf')
}
and I can see the memory usage may ebb and flow, but actually it is
leaking memory.

Yue Wang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to