[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Memory leak with lua ...
- From: Stephen Kellett <lua@...>
- Date: Tue, 24 Apr 2007 11:28:58 +0100
Asko Kauppi wrote:
I hope you've raised a list of those shortcomings to the Lua authors?
We have not.
I am sure Roberto has many things to attend to without having to keep a
software company happy.
We've made some mods to Ruby to improve the memory inspection behaviour
- they haven't been taken up by the Ruby community despite us posting
the source on our website and telling the Ruby newsgroup about it. We've
been reluctant to do the same with Lua - it would be a waste of time if
no one is interested in integrating the results of the work (for Ruby it
was only two source files, one new and a few mods to an existing file).
I'll outline the issues here. They are straight forward.
The basic problem is that there is no memory allocation hook for
reporting object creation/GC collection. Thus we've had to reverse
engineer one into the executing binary. The same applies to detecting
when a GC is about to start/has ended.
There is no way to iterate the heap, thus producing a heap dump is for
all intents and purposes impossible (we have tried).
There is no type information for an object because that is the way Lua
is. So we can't know that the variables 'orinoco' and 'montgomery' are
objects of type Womble because there is no type information to tell us that.
As a result of this type issue we are restricted to noting that
allocations are integers/strings/functions/tables/etc - the basic few
underlying types that are the foundations of Lua. Anything more abstract
than that and we have no information.
Thats a shame because if your WimbledonCommon.lua application had a
problem with litter clearing and suddenly started leaking Orinocos it
would be nice to know that was the cause.
For fans of The Clangers I can rewrite the above with comments about
Soup Dragons and Flying Teapots :-)