[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: About the behavior of Lua incremental garbage collector
- From: Rob Kendrick <lua-l@...>
- Date: Thu, 31 Jul 2008 12:12:28 +0100
On Thu, 31 Jul 2008 12:07:13 +0100
"Yunhe Shi" <shiyunhe@gmail.com> wrote:
> The following code seems to make the garbage collector unable to
> finish the gc cycle. Can anyone give me some insights into this
> problem.
>
> while not collectgarbage("step") do
> step = step + 1
> print("step: ", step, "free memory", collectgarbage("count"))
> local x = {}
> for i = 1, 1000 do
> x[i] = {}
> end
> end
I'm not played with the incremental GC at all, but surely this will
never end because your loop always creates new garbage, and thus will
always have work to do?
B.