ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Possible memory leak?
Date: Sun, 01 Feb 2009 16:03:39 +0100	[thread overview]
Message-ID: <4985B9CB.6010409@wxs.nl> (raw)
In-Reply-To: <68bfdc900902010644t71ec3644ue02d9fd29ef73282@mail.gmail.com>

Yue Wang wrote:
> Hi, Hans:
> 
> in font-afm.lua, you use fontforge to open and to_table a pfb, but
> without closing it?

ok, thanks for noticing, i added a

   fontforge.close(pfbblob)

> 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

hm so much?

> 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?)

it's hard to say ... it related to the lua garbage collector

i already discard the loaded table and reload from cache (which save 
mem) but one has to wait till the garbage collector kicks in which can 
later

also, mem consumption reported is a bit of a lie because lua seems to 
allocates double of what it needed with each increment but not always 
use it

otf fonts are already quite packed in mkiv (i'm considering adding an 
option to mtx-font to precache fonts but i'm not sure if it's worth the 
trouble

is mem consumption less a second run?

we use our mk document as test and there mem consumption is ok (given 
the number of loaded fonts)

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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	other threads:[~2009-02-01 15:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-01 14:44 Yue Wang
2009-02-01 15:03 ` Hans Hagen [this message]
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=4985B9CB.6010409@wxs.nl \
    --to=pragma@wxs.nl \
    --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).