lua-users home
lua-l archive

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


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.