[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Using Lua for config files
- From: Francisco Olarte <folarte@...>
- Date: Fri, 20 Dec 2013 10:10:18 +0100
Hi:
On Thu, Dec 19, 2013 at 9:19 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
> As the memory usage increases, the GC will be called eventually, and
> the single object 'u' created by the script will be finalized. It does
> not matter whether anything else is garbage. Just try it.
Ok, I see it now, you intentionally leak an initial table and then
leak another one in its gc to keep the gc getting called. A garbage
generation strategy.
> OBS: a good memory attack that does not need much instructions is this:
> s = "aaaaaaaaaaaaaaaaaaaa"; while true do s = s..s end
I thought of it but thought it would discard the previous value in
every loop which will trigger the garbage collection ( s1='a',
s2='aa', 'a' now garbage, ... )
Thanks.