lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I am very much in favor of as much control over GC as we can get with a reasonably good default behavior for those who don't need to fine-tune it. Having been using Lua 5.0 I have reached a point where all is needed for making GC real-time friendly is its ability to collect a given number of Kilobytes on demand in const time. If the GC is capable of doing this, one could implement any app-specific GC scheme desired. With Lua 5.0 the collection time is proportional to the number of objects in the system, it seems, that is collecting a given amount of memory (M) takes time in proportion to the number of Lua objects in existance.

Would incremental GC in Lua 5.1 allow to do this? Will we have/be able to impelent by standard means a function to the tune of 
	collect_given_amount_of_ram(mem_kb)	
whose execution time would only depend on 'mem_kb' and be virtually independent of the number of Lua objects? The ability to turn the GC off would be another desirable [debug] feature.

Thanks,
Alex 

>-----Original Message-----
>From: Jasmin Patry [mailto:jpatry@radical.ca]
>Sent: Monday, May 24, 2004 12:52 PM
>To: Lua list
>Subject: RE: The Lua 5.1(work) GC 
>
>
> 
>> Not at all. Quite the opposite: we also have little idea of 
>> what this factor (and the other constants as well) should be. 
>> We need real users with real uses (like you!!) to give us 
>> feedback about these tunnings.
>> (One concern is that, if the collector is too much agressive, 
>> it may slow down regular applications. Maybe this factor 
>> should be variable??)
>
>I think making it a variable would make sense.  Some applications can
>easily live with a less aggressive GC (e.g., relatively small 
>footprints
>apps running on PCs), while others would need a more aggressive version
>(e.g., apps for embedded devices, console games).  Some apps might even
>want to control the aggressiveness of the GC at runtime...?
>
>
>> This is an interesting addition. My only question is: why the 
>> loop? Why not a single call to luaC_step? Each program can 
>> make its own loop (with its own criteria). After all, "data" 
>> has no clear meaning anyway.
>
>The only reason the loop is there is that it was convenient for my
>purpose.  Also,
>
>   lua_gc( L, LUA_GCSTEP, 8 ) /* run the GC for 8 steps */
>
>seemed fairly intuitive.  But it's by no means essential, since as you
>said the loop can be done in the user app.
>
>Thanks,
>Jasmin
>
>
>