ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Possible memory leak?
@ 2009-02-01 14:44 Yue Wang
  2009-02-01 15:03 ` Hans Hagen
  2009-02-01 15:47 ` Taco Hoekwater
  0 siblings, 2 replies; 7+ messages in thread
From: Yue Wang @ 2009-02-01 14:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-02 22:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-01 14:44 Possible memory leak? Yue Wang
2009-02-01 15:03 ` Hans Hagen
2009-02-02  4:35   ` Yue Wang
2009-02-02  8:47     ` Hans Hagen
2009-02-02  9:13       ` Yue Wang
2009-02-02 22:14         ` Taco Hoekwater
2009-02-01 15:47 ` Taco Hoekwater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).