lua-users home
lua-l archive

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




On Thu, Jul 14, 2011 at 3:45 AM, KHMan <keinhong@gmail.com> wrote:
On 7/14/2011 7:30 AM, imo wrote:
Look at NXP's
LPC range: available up to 256kB of RAM and a
local memory bus should you need more.
Rob, yes, there are "big" controllers with memory bus available. As
I am running pic32Lua on a pic32mx695 (128kB of internal ram) and I
know the eLua is also coping desperately with the ram shortage on
those smaller ARMs, I've been curious whether an access from the VM
to the bytecode via an user defined generic ramwr/ramrd c-functions
are easy to implement (as this can create an access to any hw ram
implementation of any bytecode size) or not. It seems it would be
very difficult, moreover, there is a low demand for such change in
the VM. The Lua is running fast on pic32mx, however the 100kB
internal ram available for the bytecode is not big enough for any
larger project. FYI - the "life.lua" with LIFE(32,32) fills the ram
fully.

A bit of problem with the terminology... It's not the program bytecode that's occupying tons of space, it's the memory heap for objects created during runtime of the program. life.lua in bytecode is tiny -- but it may allocate lots of program RAM.

Exactly. Don't worry about the bytecode, that's most likely the least of your problems. The real issue here is that Lua does a lot of memory allocations and unfortunately there's not a lot one can do about that. That said, eLua can run life.lua in 128k of RAM or even less (I don't remember the exact ammount). This is probably due to the specific memory optimization patches that we have (LTR and the EGC patch from Robert Jakabosky).

Best,
Bogdan