In my experience with Lua, if I suspect that there is a memory leak with an object, I would place the object currently in use in a table and all newed objects in a WeakTable, using an ID as the index. During runtime, after performing garbage collection (gc), I can easily identify which objects have leaked by comparing these two tables. However, this approach is not feasible in JavaScript.