[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Boxed userdata and garbage collector
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 3 Sep 2010 17:29:51 -0300
> See http://lua-users.org/lists/lua-l/2007-06/msg00088.html
>
> Lightroom uses the call collectgarbage( 'step', x ) for some appropriate
> value of x when working with images, but setting x is tricky. So, I
> recently patched Lua as referenced above and have added an extraspace
> field to our proxies together with an API to adjust the extra space
> associated with the proxy. I haven't had things running long enough to
> report on how well or even if it works, but it seems promising as a way
> to keep Lua better informed of the memory in actual use.
>
> It seems like this could be a good addition to 5.2.
As I explained in another message, it seems that keeping Lua better
informed of the memory in actual use seems to have a negligible impact
on the collector (except for making it run a little slower). Unless
someone gives a good argument that this undestanding is wrong, I cannot
see why it would be a good addition to 5.2.
In Lua 5.2, on the other hand, the 'x' in collectgarbage( 'step', x )
will correspond exactly to the work the collector does when allocating
1KB of memory, so it should not be that tricky to set it.
-- Roberto