I was testing on mobile and it started to jitter and lag.
Profiler shows, with collection factories, Lua.refs kept increasing and so does memory.
To reproduce:
local pos = vmath.vector3(0, 0, 0)
function update(self, dt)
-- Simple collection with single, empty game object
local id = collectionfactory.create("#collectionfactory", pos)
go.delete_all(id)
-- Creating the same object with factory do not leak memory
--local id = factory.create("#factory", pos)
--go.delete(id)
end
I’m unable to reproduce this issue. What does the collection consist of? Please describe the game objects, their hierarchy and all components attached to them (maybe screenshot the Outline window).
Ha! Super strange. I used the web profiler, and unless I also have the visual profiler active, it won’t report Lua.Refs and Lua.Mem in the web profiler. @Mathias_Westerdahl just confirmed that this is a bug that will get fixed in the next release.
The actual issue with the memory leak has been reported as DEF-2596. Thank you so much for reporting this!