[luatex] Internet Explorer 6 leaks memory - a warning

Jonathan Fine jfine at pytex.org
Mon Jan 12 09:58:04 CET 2009


Hello

Summary:  IE6 can leak memory.  LuaTeX /might/ have the same problem.

A recent thread in this list on 'Multiple callbacks' (started by Elie 
Roux) reminded me of how the same problem is handled in JavaScript on 
web pages, and that it's fairly easy (by accident or design) to write 
JavaScript that leaks memory on Internet Explorer 6.

http://tug.org/pipermail/luatex/2009-January/000000.html
http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx
http://javascript.crockford.com/memory/leak.html

Like IE6, LuaTeX has two memory managers (TeX's and Lua's) and so some 
of the conditions for this leak are present.  I don't know if the others 
are.

(To leak memory one in IE6 create a DOM object and a JavaScript object, 
each of which references the other, and delete all other references to 
these objects.  Then there is a garbage cycle, which neither memory 
manager can detect.)

The major JavaScript libraries (Dojo, jQuery, YUI, etc) provide ways of 
attaching functions to events that avoids triggering the IE memory leak. 
  If LuaTeX can similarly leak memory, it becomes important to provide 
this functionality in a Lua module for use with LuaTeX.  And Elie Roux 
was suggesting a Lua module for attaching functions to events, which is 
where we came in.

By the way, in 2005 there was a contest to write 'the best' code for 
attaching events in JavaScript:
http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html

I'm willing to field related questions about JavaScript.

-- 
Jonathan


More information about the luatex mailing list