lua-users home
lua-l archive

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


when I create a thread and destroy it continually, I found lua 
process's memory grows up. It seems that when a thread function ends, 
the thread's internal memory does not cleared.
What should I do?

following simple code shows that sympton. 

function test_thread(n)
    write(n," thread\n")
end

for i=1,10000 do
    local t = clock()
    newthread(test_thread, {i})
    while (clock() - t < 0.01) do end -- wait a little
end