Memory leak after Script destroyed

Hi all. I am investigating into memory leak issue recently. I have made an experiment to test memory leak.
Firstly, I create a Script running on server called “testscript”. The code is below, it will alloc about 250MB memory. Although I have destroyed this script in runtime, it still hold the memory.

function test()
	local list = {}
	for i = 1, 10, 1 do
		for i = 1, 1000000, 1 do
			table.insert(list, i)
		end
		wait(0.5)
	end
end

test()

wait(5)

script:Destroy()
print("end")


1 Like

You need to wait for the Garbage Collector

1 Like

Yes, I have wait for minutes, however the Developer Console shows that the LuaHeap not be GCed

1 Like