Re: [NTG-context] Possible memory leak?
> 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. [...@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') } [...@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 ___
Re: [NTG-context] How to capture a typeset page into a box instead of shipping it out
Hello, "Kevin D. Robbins" writes: >Thanks for the suggestions Wolfgang and Luigi. I've now got several >good options to research. >Kevin > I use 3 modes for teaching: manuscript -- notes that go on-line for students to download presentation -- pictures for use in class speakernotes -- miniatures of the pictures, each on a separate page, that I scrawl on for use in class (so I know what I'm supposed to say). I got a lot of help from this list in putting these together. Context experts might find them laughable, but I'm attaching the modes in a tarball just in case they are useful. They are still evolving, by the way -- I wrote speakernotes last week, inspired by something of the same name on the wiki (sorry, I can't remember who the author is). Cheers, Roger modes.tar.gz Description: Binary data ___ 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 ___
Re: [NTG-context] Possible memory leak?
Hi Yue Wang, Yue Wang wrote: 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. I also see a non-trivila leak (somewhere inside the fontforge library). I will investigate further next week, it is not that massive. I get this result for your input file, with 500 arial.ttfs (ArialMT version 3.0, 367112 bytes): ==8819== LEAK SUMMARY: ==8819==definitely lost: 16,965,191 bytes in 707,541 blocks. ==8819== possibly lost: 1,128 bytes in 22 blocks. ==8819==still reachable: 202,135,427 bytes in 81,127 blocks. ==8819== suppressed: 0 bytes in 0 blocks. ==8819== Rerun with --leak-check=full to see details of leaked memory. So some 32kb per font. Noticeable, but not enormous. The growth in 'top' is probably caused more by memory fragmentation than by this leak. Best wishes, Taco ___ 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 ___
Re: [NTG-context] Possible memory leak?
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 ___
[NTG-context] Possible memory leak?
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 ___
Re: [NTG-context] stupbackgrounds and margin
Wolfgang Schuster writes: > Am 01.02.2009 um 14:11 schrieb Antoine Junod: > >> Hi wolfgang, and thanks for your reply. >> >> Wolfgang Schuster writes: >> >> [trying to get a red leftmargin] >> >>> Make a complete (with text) example where we can see your problem (a >>> example of the output could help), I get a red background for the >>> left margin. >> >> Here it is. And the output (processed with texexec --lua) is attached. >> >> \showframe > > \showframe overwrites the \setupbackgrounds settings, comment it and > you can see it. Thanks Wolfgang, that was that. A+ -AJ ___ 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 ___
Re: [NTG-context] stupbackgrounds and margin
Am 01.02.2009 um 14:11 schrieb Antoine Junod: Hi wolfgang, and thanks for your reply. Wolfgang Schuster writes: [trying to get a red leftmargin] Make a complete (with text) example where we can see your problem (a example of the output could help), I get a red background for the left margin. Here it is. And the output (processed with texexec --lua) is attached. \showframe \showframe overwrites the \setupbackgrounds settings, comment it and you can see it. Wolfgang ___ 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 ___
Re: [NTG-context] stupbackgrounds and margin
Hi wolfgang, and thanks for your reply. Wolfgang Schuster writes: [trying to get a red leftmargin] > Make a complete (with text) example where we can see your problem (a > example of the output could help), I get a red background for the > left margin. Here it is. And the output (processed with texexec --lua) is attached. Thanks for everything. -AJ \setuppapersize [A5][A4] \setuparranging [2UP,rotated,doublesided] \setuplayout [margin=18mm, width=middle,height=middle, topspace=0cm,backspace=18mm] \setupcolors [state=start] \setupbackgrounds [text] [leftmargin] [background=color,backgroundcolor=red] \showframe \showgrid \enableregime[utf] \starttext \section{my taylor is rich} knuthknuth \page[yes] \section{God save the Queen} knuthknuth \stoptext left_margin_in_red.pdf Description: Adobe PDF document ___ 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 ___
Re: [NTG-context] XeTeX and/or LuaTeX?
Mojca Miklavec wrote: On Sat, Jan 31, 2009 at 7:54 PM, J.A.J. Pater wrote: My guess was incorrect. I copy-pasted the underneath text into my test file and I got good results. No tXeTnoC. So here it just works like a charm. I'm sorry. I accidentally commented out \setcharactermirroring[1] while switching between XeTeX and LuaTeX. So this time just for fun: XeTeX doesn't know textdir command, so I commented out both textdir and setcharactermirroring. And then you get XtEConT with XeTeX :) :) :) xetex uses the etex bidi method (\beginL .. \endL and such) I used the wrong set of direction-switching commands, though it's still interesting that XeTeX and LuaTeX both accept input, but generate completely different results. (\pardir without \textdir has no influence in mkiv while it changes word stacking direction in XeTeX.) well, since they both use different rl machinery it can never be the same; 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 ___
Re: [NTG-context] XeTeX and/or LuaTeX?
Mojca Miklavec wrote: On Sat, Jan 31, 2009 at 12:50 AM, Hans Hagen wrote: attached a more efficient variant Hello Hans, I don't know anything about right-to-left typesetting, but is the result of this desired? (not sure if I copy-pasted properly) \sethebrew test \ConTeXt\ הָלַך test Mojca PS: I get tXeTnoC. I also get some funny results like disappearing words, but since I'm completely ignorant here, I won't even start complaining. it should be ok if automirroring is on but even then one might expect some issues we will cook up a proper bidi support model in the oriental tex project (not so much the text, but how layout, boxed and other issues has to be dealt with) currently hartmut is revisioning all directional issues (we took some code from omega but it was not always properly/consistently acting in relation with backend issues in dvi/pdf) and when that is done i'll see what is needed (the main layout is not the issue, but more details like boxed stuff, think of llap and friends as well as spacing) 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 ___
Re: [NTG-context] stupbackgrounds and margin
Am 01.02.2009 um 12:21 schrieb Antoine Junod: I'm struggling to try to do something that seems simple but I'm not able to succeed. I would like to have the left margin of my document painted in red (or another color, I don't mind right now). Here is what I have: \setuppapersize[A5][A4] \setuparranging[2UP,rotated,doublesided] \setuplayout[margin=18mm, width=middle,height=middle, topspace=0cm,backspace=18mm] \setupcolors[state=start] \setupbackgrounds[text] [leftmargin] [background=color,backgroundcolor=red] But it makes as if I had no leftmargin. What am I doing wrong? Make a complete (with text) example where we can see your problem (a example of the output could help), I get a red background for the left margin. Wolfgang ___ 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 ___
[NTG-context] stupbackgrounds and margin
Hello, list! I'm struggling to try to do something that seems simple but I'm not able to succeed. I would like to have the left margin of my document painted in red (or another color, I don't mind right now). Here is what I have: \setuppapersize[A5][A4] \setuparranging[2UP,rotated,doublesided] \setuplayout[margin=18mm, width=middle,height=middle, topspace=0cm,backspace=18mm] \setupcolors[state=start] \setupbackgrounds[text] [leftmargin] [background=color,backgroundcolor=red] But it makes as if I had no leftmargin. What am I doing wrong? Thanks for your help, A+ -AJ ___ 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 ___