So, I was researching memory and data leaks and came across something called the LUA garbage collector, and it said that it removes unused variables and frees up memory usage. And then I found a post explaining to truly get rid of a part from memory you need to run the code “part = nil”. On further googling I can’t really find anything that documents it in full detail.
My questions are
- Can destroyed [:Destroy()] parts still cause lag?
- Is it just for variables and not for the instances themselves?
- If I set a variable/part to nil, do I need to set its children to nil also?
- Are there any functions to trigger the garbage collector built into Roblox?