Re: GC Parameters & Emergency Collection

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



On Mon, May 11, 2009 at 6:34 AM, James Snyder <[hidden email]> wrote:
Minimal testing seems to show it working and surviving through conditions where previously it would run out of memory on STM32 w/ 64k SRAM.

I didn't expect anything less from this patch. I tested it on a "simulated" environment before starting to work on eLua, back when I was checking if it was at all feasible to run Lua on system limited to 64k of RAM and even less. And it performed very good. There is of course a performance penalty, but I'd say that in practice the EGC is extremely useful for thte vaste majority of applications. After all, it's quite unlikely that someone would choose eLua to run computationally intensive programs that would suffer from the performance impact :)

Best,
Bogdan


-jsnyder

On May 10, 2009, at 5:48 AM, Robert G. Jakabosky wrote:


I finally got a working i686-elf toolchain compiled and eLua to boot in a VirualBox instance.


Also I found out that eLua will not start when using the Lilo boot loader. I was trying Lilo first since it is smaller then grub and I thought it would be easier to install eLua on a floppy. Turned out that it was much easier to install grub on a floppy and there was enough room for eLua too.


On Saturday 09, jbsnyder@fanplastic.org wrote:

>

> <[hidden email]> wrote:

> >

> > Many, many thanks for this !!! I wanted to do this for quite a while

> > now, but didn't find the time to do it. Your patch is excellent for

> > eLua and its goals, so it's a Great Thing to have it running on our

> > targets. Thanks again.

>

> Ditto. Thanks for getting this up and going. I will do some testing

> with this, this weekend if I get a chance. I'm curious if this might

> allow pushing limits a bit more where we would previously run out of

> memory where the problem could be helped by emergency gc.


With the patch you can now set a memory limit when starting a Lua script from the eLua shell.


eLua# lua -m 51 /rom/life.lua


The '-m' option lets you set the memory limit in Kbytes.


51Kbytes was the lowwest I was able to get life.lua to run at with eLua. On my linux host vanilla Lua with the EGC patch can only run life.lua with a minimal memory limit of 60Kbytes. Looks like the ROTables in eLua saved about 9Kbytes here.


The attached patch is for stress testing the EGC only. It forces a full GC cycle on every allocation, so it is very slow (life.lua required over 30 minutes to run, compared to 4 minutes). I was able to run all the Lua scripts that eLua includes by default with that stress testing enabled.


Normally I would also run the stress testing under valgrind to test for any bad memory accesses, but that is only possible if eLua is run as an app. under a host OS.


> > And I couldn't agree with you more, and this why I feel so excited

> > for having EGC in eLua. I'll have to think of a good batch of tests

> > for making your patch shine in its full potential :)

>

> Would the torture tests for the egc patch work in really low memory

> conditions like with 64k of SRAM?

>

> I think we should also have a general test suite for to simplify the

> verification of builds across our multiple platforms. I think I may

> start after luarpc is working with eLua.


It should be possible to pick torture tests that will work with just 64k of memory.


I normally run the Lua scripts from:

http://shootout.alioth.debian.org/


when stress testing the EGC patch. Some of those scripts will require more then 64k for that dataset that they process.


--

Robert G. Jakabosky

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

--
James Snyder
Biomedical Engineering
Northwestern University
ph: (847) 448-0386


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



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