GC Parameters & Emergency Collection

Posted by jbsnyder on
URL: http://elua-development.15.s1.nabble.com/GC-Parameters-Emergency-Collection-tp2846858.html

Hi -

I was wondering whether there might be any objection to adjusting the  
LUAI_GCPAUSE variable, decreasing the value from 200 to 110?  This  
will cause GC to run after a 10% increase in memory allocated by Lua  
as opposed to a doubling.

I'm not sure where I'm spinning off objects, but I've recently been  
finding that for running my ADC example scripts over long periods of  
time they will sometimes bail out when Lua is unable to allocate more  
memory.  If I have the scripts periodically run a full GC however,  
they never bail.  This particular GCPAUSE value is what Ralph Hempel  
is using in pbLua (just got a copy of Lua Gems).  One case that this  
made me think about was that if I have 32k of RAM, and I've just  
allocated more than 16k of that already, I won't GC until I exceed  
available memory?  Of course, since we don't have emergency GC, this  
just means that we get an "out of memory" error and get dumped to the  
prompt.

Additionally: I've looked at the emergency GC patch minimally, and it  
looks fairly extensive.  I suppose this wouldn't work in all cases  
(presumably since GC may sometimes require memory to grow a bit before  
shrinking), but would it not be useful to attempt a GC when a new  
allocation fails?  I've thought about attempting to apply the  
emergency GC patch to eLua, but I've not bothered because 5.2 is  
intended to include some sort of emergency GC.

Another thought:  One of the reasons we don't have determinism in  
execution times is because of GC.  I've not dug into how the Lua GC  
works, but is there some way that we could have it operate in some  
sort of fixed execution time mode where with debug hooks where we  
could run it for a fixed length of time at that frequency to control  
latency?

Just some thoughts... :-)

--
James Snyder
Biomedical Engineering
Northwestern University
[hidden email]
http://fanplastic.org/key.txt
ph: (847) 448-0386


_______________________________________________
Elua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev

PGP.sig (201 bytes) Download Attachment