From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47149 Path: news.gmane.org!not-for-mail From: Yue Wang Newsgroups: gmane.comp.tex.context Subject: Re: Possible memory leak? Date: Mon, 2 Feb 2009 04:35:32 +0000 Message-ID: <68bfdc900902012035s3aee016eo34b70f94d75b112c@mail.gmail.com> References: <68bfdc900902010644t71ec3644ue02d9fd29ef73282@mail.gmail.com> <4985B9CB.6010409@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233549443 17836 80.91.229.12 (2 Feb 2009 04:37:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Feb 2009 04:37:23 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 02 05:38:36 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LTqZt-0007J5-9H for gctc-ntg-context-518@m.gmane.org; Mon, 02 Feb 2009 05:38:33 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 693BE1FB74; Mon, 2 Feb 2009 05:37:12 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25771-05; Mon, 2 Feb 2009 05:36:11 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5ABC51FBC6; Mon, 2 Feb 2009 05:36:11 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C4C141FBC6 for ; Mon, 2 Feb 2009 05:36:09 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18624-08-2 for ; Mon, 2 Feb 2009 05:35:35 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id 100041FB74 for ; Mon, 2 Feb 2009 05:35:35 +0100 (CET) Original-Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n124ZXe3025367 for ; Mon, 2 Feb 2009 05:35:34 +0100 Original-Received: by wa-out-1112.google.com with SMTP id j4so663163wah.2 for ; Sun, 01 Feb 2009 20:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=i9gOU3VDisB8us/R8vFqqrxcdlb4rHZF31/V1Ijy7is=; b=Zp1YsKyvcK05qqm0zjYuj6OaS0UBt9ddBAtyd/eEbFwt/Y5wSQ2u8KEFjHvIHHo6kD pW0rOQudf0X8KriaAyeNl1zPib3D5r6pxJ1QzhIqUn2xlbgsfp1wRGQtFtjQvUhEylHQ SfCS5TlUf1P2h5cqD5ZUQOoratDhq0usezxmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=tjP9XyYwNEYFTAY4cbl5jpdAgEqRSMggKa7auhc1uAIuy22UIHgQkXl8ms6eIEDqjO C975437dnGf6WEY2G/IljxPwWKylKxCQgnT95xwcbYowhxqmejyS+XLrlFMAvRlabFXg HNAO5CiRKiun0lsNzKfvb3PKDRTrLvjeOMOMg= Original-Received: by 10.114.89.1 with SMTP id m1mr2637987wab.188.1233549332320; Sun, 01 Feb 2009 20:35:32 -0800 (PST) In-Reply-To: <4985B9CB.6010409@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.146.181; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 173468029 - 184865a8dbe7 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:47149 Archived-At: > ok, thanks for noticing, i added a > > fontforge.close(pfbblob) > good >> 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? > Yes, when finish reading the following tex file without \bye using plain TeX, LuaTeX will cost 719M memory on my machine. The font used is Adobe song std light. [yue@localhost ~]$ cat a.tex \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('song.otf') } [yue@localhost ~]$ when using the above script loading four fonts (you can try this by adding 3 myfont = load_font('song.otf')), the memory consumption will be higher than 1G on my machine. Remember I am using Plain TeX to do this test, MKIV will consume more memory. > 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? Yes, dramatically less. with 4 chinese fonts loaded (I use zhfonts.tex for testing), MKIV consumes 300-400MB. 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 ___________________________________________________________________________________