lua-users home
lua-l archive

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


Dirk Feytons wrote:
On Fri, Jul 10, 2009 at 1:35 PM, Roberto
Ierusalimschy<roberto@inf.puc-rio.br> wrote:
So, I'd have to take care of issuing enough collectgarbage's after
reading large files or calling table.concat, right?
Yes, if you really need all the memory back as soon as possible.

To make that a bit easier it would be nice if
collectgarbage("collect") returned how much memory it released.

On a related note, I've been wondering why collectgarbage("count")
returns the current memory use in kilobytes instead of bytes? When
using Lua with an integer core instead of floating point we're losing
some precision and on an embedded platform those small bytecounts are
significant.

I posted a note on this exact problem a few months (years?) ago. I
suspect that Lua was never intended to run on little micros, but
I am certainly happy that it does :-)

Making it display bytes now could break a lot of existing code, but
it's pretty easy to mod the code to add your own option...

Ralph