From: Yue Wang <yuleopen@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Possible memory leak?
Date: Sun, 1 Feb 2009 22:44:40 +0800 [thread overview]
Message-ID: <68bfdc900902010644t71ec3644ue02d9fd29ef73282@mail.gmail.com> (raw)
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
___________________________________________________________________________________
next reply other threads:[~2009-02-01 14:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-01 14:44 Yue Wang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=68bfdc900902010644t71ec3644ue02d9fd29ef73282@mail.gmail.com \
--to=yuleopen@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).